Submission #970578

#TimeUsernameProblemLanguageResultExecution timeMemory
970578AcanikolicCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { vector<int>S(N); vector<int>D(N,-1); for(int k = 0; k < N; k++) { int index = tryCombination(S); if(index == -1) break; for(int j = 0; j < N; j++) { if(D[j] != -1) continue; S[j] ^= 1; if(tryCombination(S) != index) { D[j] = index; break; } S[j] ^= 1; } } vector<int>SS(N,1); for(int k = 0; k < N; k++) { int index = tryCombination(SS); if(index == -1) break; for(int j = 0; j < N; j++) { if(D[j] != -1) continue; SS[j] ^= 1; if(tryCombination(SS) != index) { D[j] = index; break; } SS[j] ^= 1; } } answer(S,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:36: error: cannot convert 'std::vector<int>' to 'int*'
   11 |         int index = tryCombination(S);
      |                                    ^
      |                                    |
      |                                    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:16:31: error: cannot convert 'std::vector<int>' to 'int*'
   16 |             if(tryCombination(S) != index) {
      |                               ^
      |                               |
      |                               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:25:36: error: cannot convert 'std::vector<int>' to 'int*'
   25 |         int index = tryCombination(SS);
      |                                    ^~
      |                                    |
      |                                    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:30:31: error: cannot convert 'std::vector<int>' to 'int*'
   30 |             if(tryCombination(SS) != index) {
      |                               ^~
      |                               |
      |                               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:37:12: error: cannot convert 'std::vector<int>' to 'int*'
   37 |     answer(S,D);
      |            ^
      |            |
      |            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[]);
      |             ~~~~^~~