Submission #95500

#TimeUsernameProblemLanguageResultExecution timeMemory
95500popovicirobertQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
27 / 100
1315 ms124600 KiB
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 (stderr)

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 timeMemoryGrader output
Fetching results...