Submission #668513

# Submission time Handle Problem Language Result Execution time Memory
668513 2022-12-04T03:02:41 Z RambaXGorilla Question (Grader is different from the original contest) (CEOI14_question_grader) C++17
Compilation error
0 ms 0 KB
using namespace std;
int conv[930] = {};
void fillConv(){
    if(conv[1]) return;
    for(int i = 0, j = 0;i < 1 << 12;i++){
        if(__builtin_popcount(i) == 6){
            j++;
            conv[j] = i;
        }
    }
}

int encode(int N, int X, int Y){
    fillConv();
    return __builtin_ctz(conv[X] ^ (conv[X] & conv[Y])) + 1;
}

int decode(int N, int Q, int H){
    fillConv();
    return (bool) (conv[Q] & 1 << H - 1);
}



    

Compilation message

encoder.cpp: In function 'int decode(int, int, int)':
encoder.cpp:20:37: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   20 |     return (bool) (conv[Q] & 1 << H - 1);
      |                                   ~~^~~

/usr/bin/ld: /tmp/ccgGXBMs.o: in function `main':
grader_decode.c:(.text.startup+0x22f): undefined reference to `decode(int, int, int)'
collect2: error: ld returned 1 exit status