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"
int S[101010];
int D[101010];
bool dont[101010];
void sw(int l, int r) {
for (int i = l; i <= r; i++) {
if (dont[i])continue;
S[i] ^= 1;
}
}
void exploreCave(int N) {
for (int i = 0; i < N; i++) {
int gg = tryCombination(S);
if (gg == -1 || gg >= i);
else sw(0, N - 1);
int l = 0, r = N - 1;
while (l < r) {
int mid = (l + r) / 2;
sw(l, mid);
gg = tryCombination(S);
if (gg == -1 || gg >= i)l = mid + 1;
else {
sw(l, mid);
r = mid;
}
}
D[l] = i;
dont[l] = true;
}
answer(S, D);
}
# | 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... |