Submission #94316

#TimeUsernameProblemLanguageResultExecution timeMemory
94316fjzzq2002Cave (IOI13_cave)C++14
13 / 100
781 ms640 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { vector<int> v; int o1[5005],o2[5005],t[5005],x1[5005],x2[5005]; for(int i=0;i<N;++i) v.push_back(i),t[i]=0; for(int i=0;i<N;++i) { if(tryCombination(t)==i) for(int j=0;j<N;++j) t[v[j]]^=1; int l=1,r=v.size(); while(l<r) { int m=(l+r)>>1; for(int j=0;j<m;++j) t[v[j]]^=1; if(tryCombination(t)==i) r=m; else l=m+1; for(int j=0;j<m;++j) t[v[j]]^=1; } --l; o1[i]=v[l]; o2[i]=!t[o1[i]]; v.erase(v.begin()+l); } for(int i=0;i<N;++i) x1[o1[i]]=i,x2[o1[i]]=!o2[i]; answer(x2,x1); }
#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...