Submission #231068

#TimeUsernameProblemLanguageResultExecution timeMemory
231068TehillahCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <vector> #include <set> using namespace std; void exploreCave(int N) { vector<int> S(N, 1), D(N); int ret; while(1) { ret = tryCombination(S); if(ret == -1) break; else S[ret] = !S[ret]; } set<int> st; for(int i=0; i<N; ++i) { //closing 'i'th door S[i] = !S[i]; ret = tryCombination(S); assert(ret != -1); D[i] = ret; st.insert(ret); //open 'i'th door S[i] = !S[i]; } assert((int)st.size() == N); answer(S, D); return; }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:25: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
   ret = tryCombination(S);
                         ^
cave.cpp:19:25: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
   ret = tryCombination(S);
                         ^
cave.cpp:20:3: error: 'assert' was not declared in this scope
   assert(ret != -1);
   ^~~~~~
cave.cpp:20:3: note: suggested alternative: 'answer'
   assert(ret != -1);
   ^~~~~~
   answer
cave.cpp:26:2: error: 'assert' was not declared in this scope
  assert((int)st.size() == N);
  ^~~~~~
cave.cpp:26:2: note: suggested alternative: 'answer'
  assert((int)st.size() == N);
  ^~~~~~
  answer
cave.cpp:27:13: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'void answer(int*, int*)'
  answer(S, D);
             ^