Submission #849786

#TimeUsernameProblemLanguageResultExecution timeMemory
849786JooDdaeCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" void exploreCave(int N) { int a[N], b[N], c[N]; for(int i=0;i<N;i++) a[i] = b[i] = c[i] = -1; for(int i=0;i<N;i++) { int cnt = N-i; vector<int> v; for(int j=0;j<N;j++) if(b[j] == -1) a[j] = 0, v.push_back(j); int re = tryCombination(a); int flag = (re == -1 || re > i ? 0 : 1); while(v.size() > 1) { int mid = v.size()/2; for(int i=0;i<v.size();i++) a[v[i]] = (i < mid) ^ flag; int re = tryCombination(a); if(re == -1 || re > i) v = vector(v.begin()+mid, v.end()); else v = vector(v.begin(), v.begin()+mid); } c[i] = v[0], a[c[i]] = flag, b[c[i]] = 1; } answer(a, c); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:9: error: 'vector' was not declared in this scope
   12 |         vector<int> v;
      |         ^~~~~~
cave.cpp:12:16: error: expected primary-expression before 'int'
   12 |         vector<int> v;
      |                ^~~
cave.cpp:13:55: error: 'v' was not declared in this scope
   13 |         for(int j=0;j<N;j++) if(b[j] == -1) a[j] = 0, v.push_back(j);
      |                                                       ^
cave.cpp:19:15: error: 'v' was not declared in this scope
   19 |         while(v.size() > 1) {
      |               ^
cave.cpp:29:16: error: 'v' was not declared in this scope
   29 |         c[i] = v[0], a[c[i]] = flag, b[c[i]] = 1;
      |                ^
cave.cpp:10:13: warning: unused variable 'cnt' [-Wunused-variable]
   10 |         int cnt = N-i;
      |             ^~~