Submission #95500

# Submission time Handle Problem Language Result Execution time Memory
95500 2019-02-01T16:18:15 Z popovicirobert Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
27 / 100
1315 ms 124600 KB
int encode (int N, int x, int y) {
    for(int bit = 0; bit < 10; bit++) {
        if((x & (1 << bit)) != (y & (1 << bit))) {
            return bit * 2 + ((x & (1 << bit)) > 0) + 1;
        }
    }
}
int decode (int N, int q, int h) {
    h--;
    int bit = h / 2;
    if(((q & (1 << bit)) > 0) == (h & 1)) {
        return 1;
    }
    return 0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:7:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Partially correct 1315 ms 124312 KB Output is partially correct - maxh = 20
2 Partially correct 1287 ms 124600 KB Output is partially correct - maxh = 20