Submission #207775

#TimeUsernameProblemLanguageResultExecution timeMemory
207775a_playerCave (IOI13_cave)C++14
100 / 100
1256 ms640 KiB
#include "cave.h" #include <bits/stdc++.h> #define try tryCombination using namespace std; int S[5005]; int D[5005]; int st[5005]; int N; vector<int> u; 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 l=-1,r=N-1; while(r-l>1){ int m=(l+r)/2; for(int j=0;j<N;j++)st[j]=j<=m?open:!open; for(int x:u)st[x]=S[x]; int h=try(st); if(h==i) l=m; else r=m; } D[l+1]=i; S[l+1]=open; u.push_back(l+1); } 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...