Submission #26854

# Submission time Handle Problem Language Result Execution time Memory
26854 2017-07-06T10:31:10 Z TAMREF Question (Grader is different from the original contest) (CEOI14_question_grader) C++11
0 / 100
1253 ms 25672 KB
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

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 time Memory Grader output
1 Incorrect 1253 ms 25672 KB wrong answer
2 Incorrect 1099 ms 25672 KB wrong answer