제출 #492905

#제출 시각아이디문제언어결과실행 시간메모리
492905aris12345678동굴 (IOI13_cave)C++14
컴파일 에러
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; // }

컴파일 시 표준 에러 (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[]);
      |             ~~~~^~~