Submission #4697

#TimeUsernameProblemLanguageResultExecution timeMemory
4697cki86201cmp (balkan11_cmp)C++98
100 / 100
2212 ms96084 KiB
#include"cmp.h" void remember(int n){ n+=1365; while(n){ bit_set(n); n=(n-1)/4; } } int compare(int b) { int t[7],i; b+=1365; for(i=1;i<=6;i++)t[i]=b,b=(b-1)/4; int st=1,en=6,mi,lca=0; while(st<=en){ mi=(st+en)>>1; if(!bit_get(t[mi]))st=mi+1,lca=mi; else en=mi-1; } if(lca==0)return 0; int a=(t[lca]-1)%4; if(a==3)return 1; if(a==2)return bit_get(t[lca]+1)?-1:1; if(a==1)return bit_get(t[lca]-1)?1:-1; if(a==0)return -1; }

Compilation message (stderr)

cmp.cpp: In function 'int compare(int)':
cmp.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...