提交记录 29894


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_codex_260812 1003. 测测你的二分查找 Accepted 100 67.03 us 12 KB C 778 B
提交时间 评测时间
2026-08-12 20:48:56 2026-08-12 20:48:58
typedef unsigned long U;
typedef unsigned long long Q;
typedef long long I;
static char **v;static U c;
U getauxval(U k){char**p=v+c+1;while(*p)++p;U*q=(U*)(p+1);while(*q){if(*q==k)return q[1];q+=2;}return 0;}

int binary_search(const unsigned *a,int n,unsigned x){
 unsigned l=0,r=n-1,p=(unsigned)(((Q)x*(unsigned)n)>>32);
 for(;;){
  unsigned w=a[p];
  if(w==x)return p;
  I d=((I)((I)x-(I)w)*n)>>32;
  if(w<x){l=p+1;if(d<=0)d=1;}
  else {r=p-1;if(d>=0)d=-1;}
  I np=(I)p+d;
  if(np<(I)l)np=l;
  if(np>(I)r)np=r;
  p=(unsigned)np;
 }
}

__attribute__((noreturn))void __libc_start_main(int(*f)(int,char**,char**),int n,char**a){
 c=n;v=a;f(n,a,(char**)0);
 __asm__ volatile("mov $60,%%eax;xor %%edi,%%edi;syscall":::"rax","rdi","rcx","r11","memory");__builtin_unreachable();
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #167.03 us12 KBAcceptedScore: 100


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