# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4697 | cki86201 | cmp (balkan11_cmp) | C++98 | 2212 ms | 96084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |