# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26834 | baactree | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 1885 ms | 25672 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 encode (int n, int x, int y) {
int cnta,cntb;
cnta=cntb=0;
for(int i=0;i<10;i++){
int p=x&1;
int q=y&1;
if(p>q)
return i+1;
cnta+=p;
cntb+=q;
x/=2;
y/=2;
}
for(int i=0;i<4;i++){
int p=cntb&1;
int q=cnta&1;
if(p>q)
return i+10+1;
cntb/=2;
cnta/=2;
}
return 0;
}
int decode (int n, int q, int h) {
if(h<=10){
h--;
return (q&(1<<h))>0;
}
h-=11;
int cnt=0;
for(int i=0;i<10;i++){
cnt+=q&1;
q/=2;
}
return !(cnt&(1<<h));
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |