제출 #890067

#제출 시각아이디문제언어결과실행 시간메모리
890067presko동굴 (IOI13_cave)C++14
0 / 100
174 ms496 KiB
#include "cave.h" bool found[6000]; int state[6000]; int swtch[6000]; bool start[6000]; int s[6000]; void fill(int ind,int n) { int l=0,r=n-1; while(r!=l) { int mid=(l+r+1)/2; for(int i=0;i<n;i++) { if(found[i]){s[i]=state[i];continue;} if(i<mid)s[i]=1; else s[i]=0; } int ans=tryCombination(s); bool sta=0; if(ans>ind || ans==-1)sta=1; if(sta!=start[ind])r=mid-1; else l=mid; } swtch[l]=ind; found[l]=1; state[l]=s[l]; } void exploreCave(int N) { int res=tryCombination(s); for(int i=0;i<res;i++)start[i]=1; for(int i=0;i<N;i++)fill(i,N); answer(state,swtch); }
#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...