제출 #710971

#제출 시각아이디문제언어결과실행 시간메모리
710971JJAnawat동굴 (IOI13_cave)C++17
100 / 100
1528 ms668 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; int s[5005],d[5005]; bitset<5005> found(0); void exploreCave(int n) { for(int cur=0;cur<n;cur++){ for(int i=0;i<n;i++) if(!found[i]) s[i]=0; int tt=tryCombination(s); int cr=0; if(tt==cur) cr=1; for(int i=0;i<n;i++) if(!found[i]) s[i]=cr; int l=0,r=n-1; while(l<r){ int m=(l+r)/2; for(int i=0;i<=m;i++) if(!found[i]) s[i]=!cr; tt=tryCombination(s); for(int i=0;i<n;i++) if(!found[i]) s[i]=cr; if(tt==cur) r=m; else l=m+1; } d[l]=cur; s[l]=cr; found[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...