Submission #282125

#TimeUsernameProblemLanguageResultExecution timeMemory
282125thtsshz_bgwrswhQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++17
Compilation error
0 ms0 KiB
bool first=1; string s[925]; int encode(int n,int x,int y){ int i; if(first){ first=0; s[1]="000000111111"; for(i=2;i<=920;i++){ s[i]=s[i-1]; next_permutation(s[i].begin(),s[i].end()); } } for(i=0;i<12;i++) if(s[x][i]=='1'&&s[y][i]=='0') return i+1; }
bool first=1; string s[925]; int decode(int n,int q,int h){ int i; if(first){ first=0; s[1]="000000111111"; for(i=2;i<=920;i++){ s[i]=s[i-1]; next_permutation(s[i].begin(),s[i].end()); } } return q>>(h-1)&1; }

Compilation message (stderr)

encoder.cpp:2:1: error: 'string' does not name a type
    2 | string s[925];
      | ^~~~~~
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:7:3: error: 's' was not declared in this scope
    7 |   s[1]="000000111111";
      |   ^
encoder.cpp:10:4: error: 'next_permutation' was not declared in this scope
   10 |    next_permutation(s[i].begin(),s[i].end());
      |    ^~~~~~~~~~~~~~~~
encoder.cpp:14:6: error: 's' was not declared in this scope
   14 |   if(s[x][i]=='1'&&s[y][i]=='0')
      |      ^
encoder.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^

decoder.cpp:2:1: error: 'string' does not name a type
    2 | string s[925];
      | ^~~~~~
decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:7:3: error: 's' was not declared in this scope
    7 |   s[1]="000000111111";
      |   ^
decoder.cpp:10:4: error: 'next_permutation' was not declared in this scope
   10 |    next_permutation(s[i].begin(),s[i].end());
      |    ^~~~~~~~~~~~~~~~