제출 #821333

#제출 시각아이디문제언어결과실행 시간메모리
821333annabeth9680동굴 (IOI13_cave)C++17
100 / 100
200 ms528 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; const int MAXN = 5010; bool vis[MAXN]; int S[MAXN],match[MAXN]; void exploreCave(int N){ for(int i = 0;i<N;++i){ if(tryCombination(S) == i){ for(int j = 0;j<N;++j){ if(!vis[j]) S[j] = !S[j]; } } int lo = 0, hi = N-1; while(lo < hi){ int mid = (lo+hi)/2; for(int j = lo;j<=mid;++j){ if(!vis[j]) S[j] = !S[j]; } if(tryCombination(S) == i) hi = mid; else lo = mid+1; for(int j = lo;j<=mid;++j){ if(!vis[j]) S[j] = !S[j]; } } vis[lo] = true; match[lo] = i; } answer(S,match); }
#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...