Submission #347041

#TimeUsernameProblemLanguageResultExecution timeMemory
347041ACmachineQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++17
Compilation error
0 ms0 KiB
int encode (int n, int x, int y) { int res; if(x > y){ REP(j, 12){ if((x & (1 << j))&&!(y & (1 << j))){ res = j; break; } } } else{ REP(j, 12){ if(!(x & (1 << j)) && (y & (1 << j))){ res = j; break; } } } return res; }
int decode (int n, int q, int h) { return (q & (1 << h)); }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:4:13: error: 'j' was not declared in this scope
    4 |         REP(j, 12){
      |             ^
encoder.cpp:4:9: error: 'REP' was not declared in this scope
    4 |         REP(j, 12){
      |         ^~~
encoder.cpp:12:13: error: 'j' was not declared in this scope
   12 |         REP(j, 12){
      |             ^
encoder.cpp:12:9: error: 'REP' was not declared in this scope
   12 |         REP(j, 12){
      |         ^~~