Submission #992803

#TimeUsernameProblemLanguageResultExecution timeMemory
992803Muaath_5Cave (IOI13_cave)C++17
13 / 100
257 ms544 KiB
#include "cave.h" #include <bits/stdc++.h> void exploreCave(int n) { int sure[n] = {}; int correct[n] = {}; int index[n] = {}; for (int i = 0; i < n; i++) { int l = 0, r = n-1; while (l < r) { const int mid = (l+r)/2; int cpy[n]; for (int i = 0; i < n; i++) cpy[i] = correct[i]; for (int i = mid+1; i < n; i++) if (!sure[i]) cpy[i] = 1; if (tryCombination(cpy) == i) l = mid+1; else r = mid; } index[i] = l; sure[l] = 1; } int idx[n] = {}; for (int i = 0; i < n; i++) idx[index[i]] = i; answer(correct, idx); }
#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...