Submission #492905

#TimeUsernameProblemLanguageResultExecution timeMemory
492905aris12345678Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> // #include "graderlib.cpp" #include "cave.h" using namespace std; const int mxN = 5005; void exploreCave(int n) { vector<int> doors(n, 0); vector<int> pos(n); iota(pos.begin(), pos.end(), 0); while(true) { int first = tryCombination(doors); if(first == -1) break; else doors[first] = !doors[first]; } answer(doors, pos); } // int main() { // int N = init(); // exploreCave(N); // return 0; // }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:36: error: cannot convert 'std::vector<int>' to 'int*'
   13 |         int first = tryCombination(doors);
      |                                    ^~~~~
      |                                    |
      |                                    std::vector<int>
In file included from cave.cpp:3:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:18:12: error: cannot convert 'std::vector<int>' to 'int*'
   18 |     answer(doors, pos);
      |            ^~~~~
      |            |
      |            std::vector<int>
In file included from cave.cpp:3:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~