提交记录 2045


用户 题目 状态 得分 用时 内存 语言 代码长度
lastans7 1003. 测测你的二分查找 Accepted 100 76.61 us 12 KB C 328 B
提交时间 评测时间
2018-06-21 16:19:32 2020-07-31 20:58:00
int binary_search(unsigned *a, int n, unsigned X)
{
register unsigned *L = a, *R = a + (100000000 - 1);
register unsigned long long x = X;
	while(L<R){
register unsigned *md = a + (((R - a) * (x - *L) + (L - a) * (*R - x)) / (*R - *L));
if(*md == x) return md - a; else if(*md < x) L = md + 1; else R = md - 1;
}
return L - a;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #176.61 us12 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-21 06:58:32 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠