Submission #168724

# Submission time Handle Problem Language Result Execution time Memory
168724 2019-12-15T13:57:37 Z mhy908 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
Compilation error
0 ms 0 KB
int c[930],f,i=1;
int encode(int N,int x,int y){
    if(!r)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;
    return __builtin_ffs(c[x]&(c[x]^c[y]));
}
int c[930],f,i=1;
int decode(int N,int q,int h){
    if(!r)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;
    return c[q]&1<<h-1?1:0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:3:9: error: 'r' was not declared in this scope
     if(!r)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;
         ^

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:3:9: error: 'r' was not declared in this scope
     if(!r)for(;i<=4096;i++)if(__builtin_popcount(i)==6)c[++r]=i;
         ^
decoder.cpp:4:21: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
     return c[q]&1<<h-1?1:0;
                    ~^~