# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
17405 | eaststar | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 0 ms | 0 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.
int A[930];
bool initchk=true;
void init(){
int i,j=1;
initchk=false;
for(i=63;i<4096;++i){
int cnt=__builtin_popcount(i);
if(cnt==6)A[j++]=i;
}
}
int encode(int N,int x,int y){
if(initchk)init();
x=A[x],y=A[y];
return __builtin_ffs(x&(x^y));
}
int decode(int N,int q,int h){
q=A[q];
return (q&(1<<(h-1)))>0;
}