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 a[n], b[n], c[n];
for (int i = 0; i < n; i++)
b[i] = -1, a[i] = 0;
for (int i = 0; i < n; i++){
int st = 0, en = n-1;
int value = 0;
if (tryCombination(a) == i)
value = 1;
while (st < en){
int mid = (st + en) >> 1;
for (int j = 0; j < n; j++){
if (b[j] == -1)
c[j] = (j <= mid) ^ value;
else
c[j] = a[j];
}
if (tryCombination(c) == i)
en = mid;
else
st = mid + 1;
}
b[st] = i;
a[st] = value;
}
answer(a, b);
}
# | 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... |