답안 #564823

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
564823 2022-05-19T18:17:13 Z RealSnake 질문 (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;
}
# 결과 실행 시간 메모리 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