제출 #748822

#제출 시각아이디문제언어결과실행 시간메모리
748822LIF동굴 (IOI13_cave)C++14
0 / 100
2 ms340 KiB
#include "cave.h" using namespace std; int s[5005]; int state[5005]; int now[5005]; int last[5005]; int mp[5005]; void exploreCave(int N) { int xx = tryCombination(s); if(xx != 0) now[0] = true; else now[0] = false; for(int i=0;i<N;i++) { int l = 0; int r = N; while(l<=r) { if(l == r) { int xx = tryCombination(s); if(xx == l) { s[l] ^=1; break; } } int mid = (l+r)>>1; for(int j=l;j<=mid;j++) { if(state[j] == false)s[j] ^= 1; } int xx = tryCombination(s); bool flag = false; if(xx != i)flag = true; if(now[i] != flag)l = mid+1; else r = mid; now[i] = flag; } state[l] = true; mp[i] = l; } answer(s,mp); return; }
#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...