Submission #148049

#TimeUsernameProblemLanguageResultExecution timeMemory
148049GodTeCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> Pi; typedef pair<ll, ll> Pll; // #define TT() printf("%.4f sec\n", (double) clock() / CLOCKS_PER_SEC ) #define Fi first #define Se second #define rep(i, n) for(ll i=0;i<n;i++) #define repp(i, n) for(ll i=1;i<=n;i++) #define INF 1987654321 #define IINF 987654321987654321 void exploreCave(int N){ int ans[5010] = {0,}; int cntd[5010] = {0,}; rep(i,5010){ ans[i] = 0; cntd[i] = -1; } rep(i,N){ int l = 0; int r = N-1; while(l < r){ int mid = (l+r)/2; for(int j = l; j <= mid; j++){ if(cntd[j] == -1) ans[j] = 1-ans[j]; } if(tryCombination(ans) > i) r = mid; else { for(int j = l; j <= r; j++) if(cntd[j] == -1) ans[j] = 1-ans[j]; l = mid+1; } } cntd[l] = i; } answer(ans,cntd); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:31:7: error: 'tryCombination' was not declared in this scope
    if(tryCombination(ans) > i) r = mid;
       ^~~~~~~~~~~~~~
cave.cpp:39:2: error: 'answer' was not declared in this scope
  answer(ans,cntd);
  ^~~~~~
cave.cpp:39:2: note: suggested alternative: 'ans'
  answer(ans,cntd);
  ^~~~~~
  ans