提交记录 5832


用户 题目 状态 得分 用时 内存 语言 代码长度
bzy 1003. 测测你的二分查找 Compile Error 0 0 ns 0 KB C++ 475 B
提交时间 评测时间
2018-09-03 22:04:04 2020-08-01 00:34:58
int binary_search(const unsigned *line, int ub, unsigned value){
int down = 0;register int up=ub;
    while(1){
        register int estimate = down + 
        (long long)(up - down) *
        (long long)(value -line[down]) / 
        (line[up] - line[down]);
        if(estimate == down) ++ estimate ;
        if(estimate == up  ) -- estimate ;
        if(line[estimate] == value)return estimate;
        (line[estimate] < value?down:up) = estimate;
    }
    return 0;
}
}

CompilationN/AN/ACompile ErrorScore: N/A


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