提交记录 3051
| 提交时间 |
评测时间 |
| 2018-07-04 23:14:36 |
2020-07-31 21:10:42 |
int binary_search(const unsigned *a, int n, const unsigned x)
{
static unsigned init=1, boot[16];
if(init) {
init=0;
//boot[0]=a[0];
boot[1]=a[6250000];
boot[2]=a[12500000];
boot[3]=a[18750000];
boot[4]=a[25000000];
boot[5]=a[31250000];
boot[6]=a[37500000];
boot[7]=a[43750000];
boot[8]=a[50000000];
boot[9]=a[56250000];
boot[10]=a[62500000];
boot[11]=a[68750000];
boot[12]=a[75000000];
boot[13]=a[81250000];
boot[14]=a[87500000];
boot[15]=a[93750000];
}
int t=x>=boot[8]?x>=boot[12]?x>=boot[14]?x>=boot[15]?93750000:87500000:x>=boot[13]?81250000:75000000:
x>=boot[10]?x>=boot[11]?68750000:62500000:x>=boot[9]?56250000:50000000:
x>=boot[4]?x>=boot[6]?x>=boot[7]?43750000:37500000:x>=boot[5]?31250000:25000000:
x>=boot[2]?x>=boot[3]?18750000:12500000:x>=boot[1]?6250000:0;
#define u(k) if(a[k+t]<=x)t+=k;
/*u(50000000)u(25000000)u(12500000)u(6250000)*/
u(3125000)u(1562500)u(781250)u(390625)u(195312)u(97656)u(48828)u(24414)u(12207)u(6104)u(3052)u(1526)u(763)u(381)u(191)u(95)u(48)u(24)u(12)u(6)u(3)u(1)u(1)return t;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 335.75 us | 12 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-19 07:55:15 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠