Submission #653902

#TimeUsernameProblemLanguageResultExecution timeMemory
653902AbdelmagedNourCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; const int N=5005; int s[N],d[N],done[N],now; bool check(int md){ for(int i=0;i<=md;i++)s[i]^=(!done[i]); int x=tryCombination(s); for(int i=0;i<=md;i++)s[i]^=(!done[i]); return x>now||x==-1; } void exploreCave(int n){ for(int i=0;i<n;i++){ now=i; int x=tryCombination(s); for(int j=0;j<n&&(x>i||x==-1);j++)s[j]^=(!done[j]); int l=0,r=n-1,ans; while(l<=r){ int md=(l+r)>>1; if(check(md))r=(ans=md)-1; else l=md+1; } d[ans]=i; done[ans]=1; s[ans]^=1; } answer(s,d); }

Compilation message (stderr)

cave.cpp: In function 'bool check(int)':
cave.cpp:8:11: error: 'tryCombination' was not declared in this scope
    8 |     int x=tryCombination(s);
      |           ^~~~~~~~~~~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:15: error: 'tryCombination' was not declared in this scope
   15 |         int x=tryCombination(s);
      |               ^~~~~~~~~~~~~~
cave.cpp:27:5: error: 'answer' was not declared in this scope
   27 |     answer(s,d);
      |     ^~~~~~