Submission #1142749

#TimeUsernameProblemLanguageResultExecution timeMemory
1142749AmirMakaMCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; #define ull unsigned long long #define ll long long #define ld long double #define pb push_back #define f first #define s second #define sz(x) (int)x.size() #define all(x) x.begin(),x.end() #define pii pair<int,int> #define pll pair<ll,ll> #define pld pair<ld,ld> #define pdd pair<double,double> #define mp make_pair #define AmirMakaM ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) // solve it const ull SEED = chrono::steady_clock::now().time_since_epoch().count(); mt19937_64 mrand(SEED); ull rnd(ull x = ~(0ull)) {return mrand() % x;} const ll MOD = 998244353; const ll INF = 1e16+20; const int inf = 1e9 + 7; const ll N = 4e5+5; const ll M = 2e3+1; const double pi = 2*acos(0.0); const int dx[] = {1,-1,0,0}, dy[] = {0,0,1,-1}; void exploreCave(int n) { vector<int> a(n,-1), b(n,-1); for(int i=0; i<n; i++) { vector<int> cur(n); for(int j=0; j<n; j++) { if(a[j] == -1) cur[j] = 0; else cur[j] = a[j]; } int cnt = tryCombination(cur); if(cnt == -1) { cnt = n+1; } int l = 0, r = n; while(r-l>1) { int mid=(l+r)>>1; for(int j=l; j<mid; j++) { if(a[j] == -1) cur[j] = 1; } int res = tryCombination(cur); if(res == -1) res = n+1; if(res > i) { if(cnt > i) l = mid; else r = mid; } else { if(cnt > i) r = mid; else l = mid; } for(int j=l; j<mid; j++) { if(a[j] == -1) cur[j] = 0; } } a[l] = !(cnt > i); b[l] = i; } answer(a,b); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:39:34: error: cannot convert 'std::vector<int>' to 'int*'
   39 |         int cnt = tryCombination(cur);
      |                                  ^~~
      |                                  |
      |                                  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:50:38: error: cannot convert 'std::vector<int>' to 'int*'
   50 |             int res = tryCombination(cur);
      |                                      ^~~
      |                                      |
      |                                      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:70:12: error: cannot convert 'std::vector<int>' to 'int*'
   70 |     answer(a,b);
      |            ^
      |            |
      |            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[]);
      |             ~~~~^~~