Submission #447178

#TimeUsernameProblemLanguageResultExecution timeMemory
447178zaneyucmp (balkan11_cmp)C++14
100 / 100
2347 ms102172 KiB
#include "cmp.h" void remember(int n) { n+=4096; while(n>1) bit_set(n),n/=4; } int compare(int b) { b+=4096; int l=0,r=6; bool hv=0; int d; while(l<=r){ int mid=(l+r)/2; if(!bit_get(b>>(mid*2)) and mid!=6){ l=mid+1; d=(b>>(mid*2)); hv=1; } else r=mid-1; } if(!hv) return 0; if((d%4)>1){ if(bit_get(d/4*4+3)) return -1; return 1; } else{ if(bit_get(d/4*4)) return 1; return -1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...