제출 #385125

#제출 시각아이디문제언어결과실행 시간메모리
385125Azimjon동굴 (IOI13_cave)C++17
100 / 100
270 ms1384 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int s[N], d[N]; memset(s, 0, sizeof(s)); memset(d, -1, sizeof(d)); vector<int> q; for (int i = 0; i < N; i++) { q.push_back(tryCombination(s)); int l = 0, r = N - 1; while (l < r) { int m = (l + r) / 2; for (int j = l; j <= m; j++) { if (d[j] == -1) s[j] ^= 1; } q.push_back(tryCombination(s)); if ((q.back() == i) ^ (q[q.size() - 2] == i)) { r = m; } else { l = m + 1; } } d[l] = i; if (q.back() == i) s[l] ^= 1; } 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...