Submission #481636

#TimeUsernameProblemLanguageResultExecution timeMemory
481636SlavicGCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include"cave.h" #include "bits/stdc++.h" using namespace std; #define ll long long #define forn(i,n) for(int i=0;i<n;i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(),v.rend() #define pb push_back #define sz(a) (int)a.size() void exploreCave(int n){ vector<int> a(n, 0); int x = tryCombination(a); while(x != -1){ a[x + 1] ^= 1; x = tryCombination(a); } vector<int> v(n); iota(all(v), 0); answer(v, a); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:17:28: error: cannot convert 'std::vector<int>' to 'int*'
   17 |     int x = tryCombination(a);
      |                            ^
      |                            |
      |                            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:20:28: error: cannot convert 'std::vector<int>' to 'int*'
   20 |         x = tryCombination(a);
      |                            ^
      |                            |
      |                            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:25:12: error: cannot convert 'std::vector<int>' to 'int*'
   25 |     answer(v, a);
      |            ^
      |            |
      |            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[]);
      |             ~~~~^~~