提交记录 5560


用户 题目 状态 得分 用时 内存 语言 代码长度
webmaster 1003. 测测你的二分查找 Wrong Answer 0 32.51 us 24 KB C++11 317 B
提交时间 评测时间
2018-08-29 23:53:32 2020-08-01 00:19:29
#include <algorithm>
#include <map> 

using namespace std;

int binary_search(const unsigned *a, int n, unsigned x)
{
    static map <unsigned, int> num = {{~0, n}};
    if (num.count(x))
        return num[x];
	return num[x] = lower_bound(a + num.lower_bound(x) -> second, a + num.upper_bound(x) -> second, x) - a;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #132.51 us24 KBWrong AnswerScore: 0


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