提交记录 21525
提交时间 |
评测时间 |
2024-04-12 11:27:27 |
2024-04-12 11:27:30 |
int binary_search(const unsigned *a, int n, unsigned x)
{
static unsigned ans=-1;
register unsigned l=0,r=n,mid;
while(l+4<r)
{
mid=(l+r)>>1;
if(a[mid]==x)
{
return ans=mid;
}
if(a[mid]<x)
{
l=mid+1;
}
else
{
r=mid-1;
}
}
while(a[l]^x)l++;
return l;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 328.11 us | 12 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-19 01:04:09 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠