# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
376097 | gustason | Cave (IOI13_cave) | C++14 | 88 ms | 480 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
void exploreCave(int N) {
int S[N], D[N];
for(int i = 0; i < N; i++) {
S[i] = 0;
D[i] = -1;
}
for(int i = 0; i < N; i++) {
if (tryCombination(S) < i) {
for(int i = 0; i < N; i++) {
if (D[i] != -1) continue;
S[i] ^= 1;
}
}
int l = 0, r = N, ans = r;
while(l <= r) {
int mid = (l + r) / 2;
for(int i = l; i < mid; i++) {
if (D[i] != -1) continue;
S[i] ^= 1;
}
if (tryCombination(S) < i) {
r = mid - 1;
} else {
l = mid + 1;
}
for(int i = l; i < mid; i++) {
if (D[i] != -1) continue;
S[i] ^= 1;
}
}
D[i] = l;
}
answer(S, D);
}
Compilation message (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... |