Submission #927282

#TimeUsernameProblemLanguageResultExecution timeMemory
927282Art_ogoCave (IOI13_cave)C++17
0 / 100
243 ms512 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...