提交记录 21961
提交时间 |
评测时间 |
2024-07-19 11:04:56 |
2024-07-19 11:04:59 |
/*********************************************************************
$AUTHOR$: GalenoJiao
$DATETIME$: 2024/7/19 11:00:38
*********************************************************************/
int binary_search(const unsigned *a, int n, unsigned x){
int l = -1, r = n;// a[0,l]<x a[r,n)>x
while(r-l>1){
int mid = (r+l)>>1;
if(a[mid]==x){
return mid;
}else if(a[mid]>x){
r = mid;
}else{
l = mid;
}
}
return l;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 336.66 us | 12 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-10-18 14:51:00 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用