Submission #543692

#TimeUsernameProblemLanguageResultExecution timeMemory
543692nayhzCave (IOI13_cave)C++17
0 / 100
11 ms340 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int s[5005]; // switch int ans[5005]; void exploreCave(int n) { memset(ans, -1, sizeof(ans)); int l, r, mid; bool flag, idk; for (int i = 0; i < n; i++) { l = 0, r = n - 1; flag = (tryCombination(s) == i); while (l <= r) { mid = (l + r) / 2; for (int j = l; j <= mid; j++) if (ans[j] == -1) s[j] = 1; idk = (tryCombination(s) == i); if (flag == idk) l = mid + 1; else r = mid - 1; } ans[l] = i, s[l] = flag; } answer(s, ans); }
#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...