提交记录 1995


用户 题目 状态 得分 用时 内存 语言 代码长度
alphaGem 1003. 测测你的二分查找 Accepted 100 202.84 us 12 KB C 302 B
提交时间 评测时间
2018-06-21 15:04:56 2020-07-31 20:57:22
int binary_search(unsigned *a,int n,register unsigned x)
{
	register unsigned*p=a+1ll*n*x/a[n-1];
	if(x<=*p)
	{
		register int t=4;
		for(;p[-t]>x;t<<=4);
		for(;t>>=1;)p[-t]>=x?p-=t:0;
		return p-a;
	}
	else
	{
		register int t=4;
		for(;p[t]<x;t<<=4);
		for(;t>>=1;)p[t]<=x?p+=t:0;
		return p-a;
	}
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1202.84 us12 KBAcceptedScore: 100


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