Submission #347043

# Submission time Handle Problem Language Result Execution time Memory
347043 2021-01-11T15:26:52 Z ACmachine Question (Grader is different from the original contest) (CEOI14_question_grader) C++17
0 / 100
2310 ms 24284 KB
int encode (int n, int x, int y) {
    int res;
    if(x > y){
        for(int j = 0; j < 12; ++j){
            if((x & (1 << j))&&!(y & (1 << j))){
                res = j;
                break;
            }
        }
    }
    else{
        for(int j = 0; j < 12; ++j){
            if(!(x & (1 << j)) && (y & (1 << j))){
                res = j;
                break;
            }
        }
    }
    return res + 1;
}
int decode (int n, int q, int h) {
    return (q & (1 << (h-1)));
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:19:18: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
   19 |     return res + 1;
      |                  ^
# Verdict Execution time Memory Grader output
1 Incorrect 2310 ms 24216 KB wrong answer
2 Incorrect 2290 ms 24284 KB wrong answer