Submission #710459

#TimeUsernameProblemLanguageResultExecution timeMemory
710459Urvuk3Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

#define EPS 1e-9
#define ll long long
const int INF=1e9,MAXN=3001;
const ll LINF=1e18,MOD=1e9+7;
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define mid ((l+r)/2)
#define sz(a) (int((a).size()))
#define all(a) a.begin(),a.end()
#define endl "\n"
#define PRINT(x) cerr<<#x<<'='<<x<<endl;
#define pb push_back
#define PRINTvec(niz) { cerr<<#niz<<"="; for(auto _i:niz) cerr<<_i<<" "; cerr<<endl; }

void exploreCave(int N){
    int S[N],D[N],mask[N];
    vector<bool> fixed(N,false);
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(!fixed[j]) mask[j]=0;
        }
        int type=0;
        if(tryCombination(mask)==i){
            type=1;
            for(int j=0;j<N;j++) if(!fixed[j]) mask[j]=1;
        }
        //PRINT(i); PRINT(type);
        int l=0,r=N-1;
        while(l<r){
            int l1=l,r1=mid,l2=mid+1,r2=r;
            for(int j=l1;j<=r1;j++) if(!fixed[j]) mask[j]=!type;
            if(tryCombination(mask)!=i){
                l=l2,r=r2;
            }
            else{
                for(int j=l1;j<=r1;j++) if(!fixed[j]) mask[j]=type;
                for(int j=l2;j<=r2;j++) if(!fixed[j]) mask[j]=!type;
                l=l1,r=r1;
            }
        }
        //PRINT(l);
        S[l]=type;
        fixed[l]=true;
        D[l]=i;
        //cerr<<endl;
    }
    answer(S,D);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:29:12: error: 'tryCombination' was not declared in this scope
   29 |         if(tryCombination(mask)==i){
      |            ^~~~~~~~~~~~~~
cave.cpp:38:16: error: 'tryCombination' was not declared in this scope
   38 |             if(tryCombination(mask)!=i){
      |                ^~~~~~~~~~~~~~
cave.cpp:53:5: error: 'answer' was not declared in this scope
   53 |     answer(S,D);
      |     ^~~~~~