Submission #981410

#TimeUsernameProblemLanguageResultExecution timeMemory
981410batsukh2006Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N) { vector<int> pos(N),ans(N); for(int i=0; i<N; i++){ ans[i]=i; if(tryCombination(pos)==i) pos[i]=1; } answer(pos,ans); }

Compilation message (stderr)

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