Submission #317335

# Submission time Handle Problem Language Result Execution time Memory
317335 2020-10-29T14:09:08 Z Sho10 Cave (IOI13_cave) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#include "cave.h"
#define ll long long
#define double long double
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005ll
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int n,pos[5005],ans[5005],x[5005],s1,s2;
ll check(ll val,ll l,ll r){
for(ll i=l;i<=r;i++)
{
    if(x[i]==0){
        ans[i]^=1;
    }
}
s1=s2;
s2=tryCombination(ans);
if(s2==-1){
    s2=n;
}
if(s1==val&&s2==val){
    return 0;
}else if(s1==val||s2==val){
return 1;
}else return 0;
}
void exploreCave(int N){
n=n;
for(ll i=0;i<=n;i++)
{
    ll l=0,r=n-1;
    s2=trycombination(ans);
    if(s2==-1){
        s2=n;
    }
    while(l<r){
        ll mid=(l+r)/2;
        if(check(i,l,mid)){
            r=mid;
        }else l=mid+1;
    }
    if(s2==i){
        ans[l]^=1;
    }
    pos[l]=i;
    x[l]=1;
}
answer(ans,pos);
}
/*
int32_t main(){
CODE_START;
*/

Compilation message

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:46:8: error: 'trycombination' was not declared in this scope; did you mean 'tryCombination'?
   46 |     s2=trycombination(ans);
      |        ^~~~~~~~~~~~~~
      |        tryCombination