Submission #564823

# Submission time Handle Problem Language Result Execution time Memory
564823 2022-05-19T18:17:13 Z RealSnake Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
60 / 100
3063 ms 24064 KB
int encode(int n, int x, int y) {
    for(int i = 0; i < 10; i++) {
        if((x & (1 << i)) && !(y & (1 << i)))
            return i + 1;
    }
    x = __builtin_popcount(x);
    y = __builtin_popcount(y);
    for(int i = 0; i < 4; i++) {
        if(!(x & (1 << i)) && (y & (1 << i)))
            return i + 11;
    }
    return 0;
}
int decode(int n, int q, int h) {
    if(h <= 10)
        return (q & (1 << (h - 1))) > 0;
    q = __builtin_popcount(q);
    return (q & (1 << (h - 11))) == 0;
}
# Verdict Execution time Memory Grader output
1 Partially correct 2984 ms 24064 KB Output is partially correct - maxh = 14
2 Partially correct 3063 ms 24056 KB Output is partially correct - maxh = 14