제출 #720208

#제출 시각아이디문제언어결과실행 시간메모리
720208Yell0동굴 (IOI13_cave)C++17
63 / 100
2032 ms716 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int config[N],perm[N]; set<int> idx; for(int i=0;i<N;++i) idx.insert(i); for(int i=0;i<N;++i) { int on=1; for(int x:idx) config[x]=1; if(tryCombination(config)==i) on=0; for(int x:idx) config[x]=!on; int lo=0,hi=N-i-1; while(lo<=hi) { int mid=(lo+hi)/2,j=0; for(int x:idx) { if(j>mid) break; if(j++<lo) continue; config[x]=on; } if(tryCombination(config)==i) lo=mid+1; else hi=mid-1; for(int x:idx) config[x]=!on; } auto x=idx.begin(); advance(x,lo); config[*x]=on; perm[*x]=i; idx.erase(*x); } answer(config,perm); }
#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...