제출 #543694

#제출 시각아이디문제언어결과실행 시간메모리
543694nayhz동굴 (IOI13_cave)C++17
0 / 100
11 ms340 KiB
#include "cave.h" #include <bits/stdc++.h> #define ll long long using namespace std; int s[5005]; // switch int ans[5005]; void exploreCave(int n) { memset(ans, -1, sizeof(ans)); ll 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...