제출 #1312202

#제출 시각아이디문제언어결과실행 시간메모리
1312202orgiloogiiCave (IOI13_cave)C++20
0 / 100
183 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; #define ll long long void exploreCave(int n) { int res[n]; int state[n]; for (int i = 0;i < n;i++) { state[i] = -1; res[i] = -1; } int temp[n]; for (int i = 0;i < n;i++) { int onstate = -1; for (int i = 0;i < n;i++) { if (state[i] == -1) temp[i] = 0; else temp[i] = state[i]; } int block = tryCombination(temp); if (block == i) { onstate = 1; } else { onstate = 0; } int l = 0, r = n + 1; while (l + 1 < r) { int mid = (l + r) / 2; for (int i = l;i <= mid;i++) { if (state[i] == -1) temp[i] = onstate; else temp[i] = state[i]; } block = tryCombination(temp); if (block == i) { l = mid; } else { r = mid; } } state[l] = onstate; res[i] = l; } answer(state, res); } //int main() { // //}
#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...