提交记录 13020
提交时间 |
评测时间 |
2020-07-19 11:09:58 |
2020-08-01 03:03:17 |
int binary_search(const unsigned *a, int n, unsigned X)
{
register const unsigned *L = a, *R = a + (100000000 - 1);
register unsigned long long x = X;
while(L<R){
register int md = ((R - a) * (x - *L) + (L - a) * (*R - x)) / (*R - *L);
if(a[md] == x) return md; else if(a[md] < x) L = a + (md + 1); else R = a + (md - 1);
}
return L - a;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 78.16 us | 12 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-24 02:41:19 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠