Submission #107219

#TimeUsernameProblemLanguageResultExecution timeMemory
107219SecretAgent007Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "cave.h" #define int long long const int INF = 1e18; /////////////////////////////////////////////////// vector< int > input; vector< int > openWith; int n; vector< int > known; void flip(int a, int b, int v[]){ for(int i = a; i <= b; i++){ if(known[i] != -1) v[i] = known[i]; else if(v[i] == 0) v[i] = 1; else v[i] = 0; } } int interrupt; bool type; void query(int l, int r, int door, bool greater, int v[]){ if(l == r){ interrupt = l; if(greater){ type = v[l]; }else{ if(v[l]) type = 0; else type = 1; } return; } int mid = (l+r)/2; if(greater){ flip(l,mid,v); int re = tryCombination(v); if(re == -1) re = INF; if(re > door){ query(mid+1,r,door,1,v); }else{ query(l,mid,door,0,v); } }else{ flip(l,mid,v); int re = tryCombination(v); if(re == -1) re = INF; if(re > door){ query(l,mid,door,1,v); }else{ query(mid+1,r,door,0,v); } } } void exploreCave(int N){ known.assign(N,-1); int v[N]; int D[N]; bool verif; int S[N]; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++) v[j] = 1; flip(0,N-1,v); int r = tryCombination(v); if(r == -1 || r > i) verif = true; else verif = false; query(0,N-1,i,verif,v); D[interrupt] = i; known[interrupt] = type; S[interrupt] = type; } answer(S,D); } signed main(){ ios::sync_with_stdio(false); cin.tie(0); cin >> n; input.resize(n); openWith.resize(n); for(int i = 0; i < n; i++){ cin >> input[i]; } for(int i = 0; i < n; i++){ cin >> openWith[i]; } exploreCave(n); }

Compilation message (stderr)

cave.cpp: In function 'void query(long long int, long long int, long long int, bool, long long int*)':
cave.cpp:45:28: error: cannot convert 'long long int*' to 'int*' for argument '1' to 'int tryCombination(int*)'
   int re = tryCombination(v);
                            ^
cave.cpp:54:28: error: cannot convert 'long long int*' to 'int*' for argument '1' to 'int tryCombination(int*)'
   int re = tryCombination(v);
                            ^
cave.cpp: In function 'void exploreCave(long long int)':
cave.cpp:80:27: error: cannot convert 'long long int*' to 'int*' for argument '1' to 'int tryCombination(int*)'
   int r = tryCombination(v);
                           ^
cave.cpp:91:12: error: cannot convert 'long long int*' to 'int*' for argument '1' to 'void answer(int*, int*)'
  answer(S,D);
            ^