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