Submission #405722

# Submission time Handle Problem Language Result Execution time Memory
405722 2021-05-16T20:45:51 Z Victor Question (Grader is different from the original contest) (CEOI14_question_grader) C++17
0 / 100
2 ms 400 KB
#define rep(i, a, b) for (int i = a; i < (b); ++i)

int encode(int n, int x, int y) {
    rep(i, 0, 12) if (x & 1 << i && !(y & 1 << i)) return i + 1;
    return 0;
}
int decode(int n, int q, int h) {
    return q & 1 << h - 1 ? 1 : 0;
}

Compilation message

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:2:23: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
    2 |     return q & 1 << h - 1 ? 1 : 0;
      |                     ~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 400 KB the encoded value must be greater than or equal to 1
2 Incorrect 2 ms 400 KB the encoded value must be greater than or equal to 1