Submission #26834

#TimeUsernameProblemLanguageResultExecution timeMemory
26834baactreeQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
60 / 100
1885 ms25672 KiB
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 timeMemoryGrader output
Fetching results...