제출 #383504

#제출 시각아이디문제언어결과실행 시간메모리
383504nicholask동굴 (IOI13_cave)C++14
100 / 100
254 ms1428 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N){ int s[N],d[N]; for (int i=0; i<N; i++){ s[i]=0; d[i]=-1; } vector <int> ret; for (int i=0; i<N; i++){ ret.push_back(tryCombination(s)); int l=0,r=N-1; while (l<r){ int mid=(l+r)/2; for (int j=l; j<=mid; j++){ if (d[j]==-1) s[j]^=1; } bool a=(ret.back()==i); ret.push_back(tryCombination(s)); bool b=(ret.back()==i); if (a^b) r=mid; else l=mid+1; } if (ret.back()==i) s[l]^=1; d[l]=i; } 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...