Submission #207768

#TimeUsernameProblemLanguageResultExecution timeMemory
207768a_playerCave (IOI13_cave)C++14
0 / 100
878 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> #define try tryCombination using namespace std; const int MAXN = 5e3+5; int S[MAXN]; int D[MAXN]; int st[MAXN]; int N; bool check(int t,bool open, int i){ for(int j=0;j<=t&&j<N;j++)st[j]=open; for(int j=t+1;j<N;j++)st[j]=!open; for(int j=0;j<i;j++)st[D[j]]=S[D[j]]; int h=try(st); return h==i; } void exploreCave(int N){ ::N=N; for(int i=0;i<N;i++){ int t=try(S); bool open=false; if(t==i)open=true; int x=-1; for(int b=N;b>=1;b/=2) while(check(x+b,open,i))x+=b; D[i]=x+1; S[D[i]]=open; } answer(S,D); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...