Submission #26854

#TimeUsernameProblemLanguageResultExecution timeMemory
26854TAMREFQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++11
0 / 100
1253 ms25672 KiB
int encode (int n, int x, int y) { int h=0; for(;x&1<<h == y&1<<h;++h); return 2*h + 1 + (x&1<<h?1:0); }
int decode (int n, int q, int h) { --h; return q&1<<(h/2)?(h%2):!(h%2); }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:3:15: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   for(;x&1<<h == y&1<<h;++h);
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...