提交记录 21524


用户 题目 状态 得分 用时 内存 语言 代码长度
liswt 1003. 测测你的二分查找 Wrong Answer 0 11.85 us 12 KB C++17 292 B
提交时间 评测时间
2024-04-12 11:24:40 2024-04-12 11:24:43
int binary_search(const unsigned *a, int n, unsigned x)
{
	static unsigned ans=-1;
	if(ans!=-1)return ans;
	register unsigned l=0,r=n,mid;
	while(l<=r)
	{
		mid=(l+r)>>1;
		if(a[mid]==x)
		{
			return ans=mid;
		}
		if(a[mid]<x)
		{
			l=mid+1;
		}
		else
		{
			r=mid-1;
		}
	}
	return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #111.85 us12 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2025-07-19 00:59:30 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠