# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
730308 | Desh03 | 동굴 (IOI13_cave) | C++17 | 53 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cave.h>
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int n) {
int v[n], d[n];
int f = 0;
while (f != n) {
int l = f, r = n - 1;
int s[n];
for (int i = 0; i < n; i++) {
if (d[i]) s[i] = v[i];
else s[i] = 0;
}
int x = tryCombination(s), to_check;
if (x == f) to_check = 0;
else to_check = 1;
for (int i = 0; i < n; i++) {
if (d[i]) s[i] = v[i];
else s[i] = to_check;
}
while (l < r) {
int m = l + r >> 1;
for (int i = l; i <= m; i++)
if (!d[i]) s[i] ^= 1;
x = tryCombination(s);
if (x != f) {
for (int i = l; i <= m; i++)
if (!d[i]) s[i] ^= 1;
r = m;
} else l = m + 1;
}
v[l] = to_check, d[l] = f++;
}
answer(v, d);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |