Submission #151986

#TimeUsernameProblemLanguageResultExecution timeMemory
151986emaborevkovicQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
Compilation error
0 ms0 KiB
int a[15]; vector <int> v[930]; int brr; int b[15]; void prek (int pos) { if (pos == 12) { int br = 0; for (int i=0;i<12;i++) br+=a[i]; if (br != 6) return; for (int i=0;i<12;i++) { if (a[i]) v[brr].push_back(i); } brr++; return; } a[pos] = 1; prek (pos+1); a[pos] = 0; prek (pos+1); } int encode (int n, int x, int y) { prek(0); x--; y--; for (int i=0;i<6;i++) { b[v[x][i]]++; b[v[y][i]]--; } for (int i=0;i<12;i++) { if (b[i] == 1) return i+1; } }
int a[15]; vector <int> v[930]; int brr; int b[15]; void prek (int pos) { if (pos == 12) { int br = 0; for (int i=0;i<12;i++) br+=a[i]; if (br != 6) return; for (int i=0;i<12;i++) { if (a[i]) v[brr].push_back(i); } brr++; return; } a[pos] = 1; prek (pos+1); a[pos] = 0; prek (pos+1); } int decode (int n, int q, int h) { prek(0); q--; h--; for (int i=0;i<6;i++) { if (v[q][i] == h) return 1; } return 0; }

Compilation message (stderr)

encoder.cpp:2:1: error: 'vector' does not name a type
 vector <int> v[930];
 ^~~~~~
encoder.cpp: In function 'void prek(int)':
encoder.cpp:12:14: error: 'v' was not declared in this scope
    if (a[i]) v[brr].push_back(i);
              ^
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:27:5: error: 'v' was not declared in this scope
   b[v[x][i]]++;
     ^
encoder.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

decoder.cpp:2:1: error: 'vector' does not name a type
 vector <int> v[930];
 ^~~~~~
decoder.cpp: In function 'void prek(int)':
decoder.cpp:12:14: error: 'v' was not declared in this scope
    if (a[i]) v[brr].push_back(i);
              ^
decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:27:7: error: 'v' was not declared in this scope
   if (v[q][i] == h) return 1;
       ^