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 a[N] = {}, D[N], P[N] = {};
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
if (!P[j]) {
a[j] = 0;
}
}
int right = tryCombination(a) != i;
cout << right << endl;
int l = 0, r = N - 1;
while (l < r) {
int mid = (l + r) / 2;
for (int j = 0; j < N; ++j) {
if (!P[j]) {
a[j] = j <= mid ? right : !right;
}
}
if (tryCombination(a) == i) {
r = mid;
}
else {
l = mid + 1;
}
}
D[l] = i;
a[l] = !right;
P[l] = 1;
}
answer(a, 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... |