Submission #16204

#TimeUsernameProblemLanguageResultExecution timeMemory
16204mindolCave (IOI13_cave)C++98
0 / 100
7 ms512 KiB
#include "cave.h" int door[5001],a[5001]; bool ans[5001]; int where[5001]; void exploreCave(int N) { for(int i=0;i<N;i++) { int s=0,e=N-1; for(int j=0;j<N;j++) if(ans[j]==0) a[j]=0; int res=tryCombination(a); if(res!=i) { for(int j=0;j<N;j++) if(ans[j]==0) a[j]=1; } while(s<=e) { int mid=(s+e)/2; for(int j=s;j<=mid;j++) if(ans[j]==0) a[j]=!a[j]; int res=tryCombination(a); if(res==i) // 뒷쪽에 있음 { for(int j=s;j<=mid;j++) if(ans[j]==0) a[j]=!a[j]; s=mid+1; } else // 앞쪽에 있음 { for(int j=s;j<=mid;j++) if(ans[j]==0) a[j]=!a[j]; e=mid; } } ans[s]=true; where[s]=i; door[s]=!a[s]; } answer(door,where); }
#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...