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"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
int S[N], D[N], A[N]{};
fill(D, D + N, -1);
for (int i = 0; i < N; i++) {
bool f = tryCombination(A) == i;
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) {
A[j] ^= 1;
}
}
bool g = tryCombination(A) == i;
for (int j = l; j <= m; j++) {
if (D[j] == -1) {
A[j] ^= 1;
}
}
if (f == g) {
l = m + 1;
} else {
r = m;
}
}
S[l] = i;
D[l] = f;
A[l] = f;
}
answer(D, S);
}
# | 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... |