Submission #260225

#TimeUsernameProblemLanguageResultExecution timeMemory
260225islingrQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++17
0 / 100
2 ms384 KiB
int encode(int n, int x, int y) {
  int h[924];
  for (int S = 0, c = 0; c != 924; ++S)
    if (__builtin_popcount(S) == 6)
      h[c++] = S;
  x = h[x]; y = h[x];
  for (int i = 0; i < 12; ++i)
    for (int j = 0; j < 12; ++j)
      if ((x & 1 << i) && (~y & 1 << j))
        return i + 1;
}
int decode(int n, int q, int k) {
  int h[924];
  for (int S = 0, c = 0; c != 924; ++S)
    if (__builtin_popcount(S) == 6)
      h[c++] = S;
	q = h[q];
	return q >> --k & 1;
}

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:11:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...