Submission #655093

#TimeUsernameProblemLanguageResultExecution timeMemory
655093angelo_torresCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { vector<int> S,D; for(int i = 0; i < N; ++i){ vector<int> s(N); for(auto &it : s) it = 0; bool fl = (i == tryCombination(s)); int l = 0, r = N-1; while(r != l){ int md = (l+r)>>1; int kl = l, kr = md; for(int j = l; j <= md; ++j) s[j] = 1-s[j]; bool gl = (i == tryCombination(s)); if(fl == gl) l = md+1; else r = md; for(int j = kl; j <= kr; ++j) s[j] = 1-s[j]; } if(fl) S[l] = 1-s[l]; else S[l] = s[l]; D[l] = i; } answer(S,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:40: error: cannot convert 'std::vector<int>' to 'int*'
   11 |         bool fl = (i == tryCombination(s));
      |                                        ^
      |                                        |
      |                                        std::vector<int>
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:17:44: error: cannot convert 'std::vector<int>' to 'int*'
   17 |             bool gl = (i == tryCombination(s));
      |                                            ^
      |                                            |
      |                                            std::vector<int>
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:26:12: error: cannot convert 'std::vector<int>' to 'int*'
   26 |     answer(S,D);
      |            ^
      |            |
      |            std::vector<int>
In file included from cave.cpp:2:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~