Submission #168729

# Submission time Handle Problem Language Result Execution time Memory
168729 2019-12-15T14:02:04 Z mhy908 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
100 / 100
1496 ms 79600 KB
int c[930],r,i=4097;
int encode(int N,int x,int y){
    if(!r)while(--i)__builtin_popcount(i)==6?c[++r]=i:r;
    return __builtin_ffs(c[x]&(c[x]^c[y]));
}
int c[930],r,i=4097;
int decode(int N,int q,int h){
    if(!r)while(--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;
                    ~^~
# Verdict Execution time Memory Grader output
1 Correct 1496 ms 79368 KB Output is correct - maxh = 12
2 Correct 1488 ms 79600 KB Output is correct - maxh = 12