提交记录 13829
| 提交时间 |
评测时间 |
| 2020-08-12 18:19:46 |
2020-08-12 18:19:50 |
bool first = 1;
int lst, lstx;
int l, r;
int binary_search(const unsigned *a, int n, unsigned x)
{
if (first)
{
first = 0;
l=0;r=n-1;
}
else
{
if(x==lstx)return lst;
if(x>lstx)l=lst+1,r=n-1;
else l=0,r=lst-1;
}
lstx=x;
while(l<=r){
int mid=l+r>>1;
if(a[mid]==x)return lst=mid;
else if(a[mid]>x)l=mid+1;
else r=mid-1;
}
return lst;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 19.1 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-23 15:42:17 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠