Submission #343847

#TimeUsernameProblemLanguageResultExecution timeMemory
343847beksultan04Question (Grader is different from the original contest) (CEOI14_question_grader)C++14
Compilation error
0 ms0 KiB
int pp[10001],cnt; int encode (int n, int x, int y) { if (!cnt){ for (int i=31;i<(1<<12);++i){ if (__builtin_popcount(i) == 6)ans[cnt++]=i; } } x = pp[x-1]; y = pp[y-1]; for (i=0;i<=12;++i){ if ((x&(1<<i)) && !(y&(1<<i)))ret i+1; } return 0; }
int pp[10001],cnt; int decode (int n, int q, int h) { if (!cnt){ for (int i=31;i<(1<<12);++i){ if (__builtin_popcount(i) == 6)ans[cnt++]=i; } } q = pp[q-1]; ret (q&(1<<h-1)); }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:6:44: error: 'ans' was not declared in this scope
    6 |             if (__builtin_popcount(i) == 6)ans[cnt++]=i;
      |                                            ^~~
encoder.cpp:12:10: error: 'i' was not declared in this scope
   12 |     for (i=0;i<=12;++i){
      |          ^
encoder.cpp:13:39: error: 'ret' was not declared in this scope
   13 |         if ((x&(1<<i)) && !(y&(1<<i)))ret i+1;
      |                                       ^~~

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:6:44: error: 'ans' was not declared in this scope
    6 |             if (__builtin_popcount(i) == 6)ans[cnt++]=i;
      |                                            ^~~
decoder.cpp:10:17: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   10 |     ret (q&(1<<h-1));
      |                ~^~
decoder.cpp:10:5: error: 'ret' was not declared in this scope
   10 |     ret (q&(1<<h-1));
      |     ^~~
decoder.cpp:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^