提交记录 20359
提交时间 |
评测时间 |
2023-10-13 21:06:15 |
2023-10-13 21:06:18 |
int binary_search(const unsigned *a, int n, unsigned x)
{unsigned l=614514,r=n-614751,mid;unsigned long long X=x;
while(l<=r-2){
mid=(r*(X-a[l])+l*(a[r]-X))/(a[r]-a[l]);
if(a[mid]==x){
return mid;
}if(a[mid]<x)l=mid+1;
else r=mid-1;
}
if(a[l]==x)return l;
if(a[l+1]==x)return l+1;
return l+2;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 75.48 us | 12 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-09-13 09:31:34 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠