提交记录 16962


用户 题目 状态 得分 用时 内存 语言 代码长度
user1 1003. 测测你的二分查找 Wrong Answer 0 122.67 us 12 KB C++ 346 B
提交时间 评测时间
2021-11-12 18:06:58 2021-11-12 18:07:01
#include <algorithm>

int binary_search(const unsigned *a, int n, unsigned x)
{
int ne = x*0.023283064365386963;
const unsigned *e = a + std::min(100000000,ne+4000);
const unsigned *b = std::lower_bound(a+std::max(0,ne-4000), e, x);
if(b!=e) return b-a;
	return std::lower_bound(a+std::max(0,ne-40000), a + std::min(100000000,ne+40000), x) - a;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1122.67 us12 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-18 08:31:48 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠