제출 #927281

#제출 시각아이디문제언어결과실행 시간메모리
927281Art_ogo동굴 (IOI13_cave)C++17
0 / 100
200 ms520 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int S[N]; int D[N]; bool ok[N]; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++) if(!ok[j]) S[j] = 0; int ans = tryCombination(S); if(ans == i) for(int j = 0; j < N; j++) if(!ok[j]) S[j] = 1; int l = 0, r = N - 1; while(l < r){ int mid = (l + r) >> 1; for(int j = l; j <= mid; j++) if(!ok[j]) S[j] = 1 - S[j]; ans = tryCombination(S); for(int j = l; j <= mid; j++) if(!ok[j]) S[j] = 1 - S[j]; if(ans == i) r = mid; else l = mid + 1; } ok[l] = 1; D[l] = i; cout << l << endl; } 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...