제출 #16266

#제출 시각아이디문제언어결과실행 시간메모리
16266CodingBug동굴 (IOI13_cave)C++98
100 / 100
311 ms512 KiB
#include "cave.h" #define M 5000 void exploreCave(int N) { bool ch[N]; int s[N],a[N],i,j; for(i=0;i<N;i++){ ch[i]=false; s[i]=0; a[i]=0; } for(i=0;i<N;i++){ int p,p2=tryCombination(s); int st,ed,mi; for(st=0,ed=N-1;st<ed;((p==i)^((p2=tryCombination(s))==i)) ? st=mi+1 : ed=mi){ p=p2; mi=(st+ed)/2; for(j=mi+1;j<=ed;j++) if(!ch[j]) s[j]=!s[j]; } if(p2==i) s[st]=!s[st]; ch[st]=true; a[st]=i; } answer(s,a); }
#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...