답안 #168728

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168728 2019-12-15T14:00:46 Z mhy908 질문 (CEOI14_question_grader) C++14
100 / 100
1561 ms 79904 KB
int c[930],r,i=1;
int encode(int N,int x,int y){
    if(!r)for(;i<=4096;i++)__builtin_popcount(i)==6?c[++r]=i:r;
    return __builtin_ffs(c[x]&(c[x]^c[y]));
}
int c[930],r,i=1;
int decode(int N,int q,int h){
    if(!r)for(;i<=4096;i++)__builtin_popcount(i)==6?c[++r]=i:r;
    return c[q]&1<<h-1?1:0;
}

Compilation message

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:4:21: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
     return c[q]&1<<h-1?1:0;
                    ~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 1528 ms 79432 KB Output is correct - maxh = 12
2 Correct 1561 ms 79904 KB Output is correct - maxh = 12