Submission #343844

#TimeUsernameProblemLanguageResultExecution timeMemory
343844beksultan04Question (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 ;
}
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;
      |                                       ^~~
encoder.cpp:16:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   16 |     return ;
      |     ^~~~~~

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 | }
      | ^