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)
{
/// full task
int s = -2;
vector < int > a (n), b (n, -1);
for (int i = 0; i < n; ++i)
{
if (s == -2) s = tryCombination (&a[0]);
int l = 0, r = n;
while (l < r)
{
if (l + 1 == r) break;
int m = (l + r) / 2;
for (int j = l; j < m; ++j)
if (b[j] == -1)
a[j] = !a[j];
int t = tryCombination (&a[0]);
for (int j = l; j < m; ++j)
if (b[j] == -1)
a[j] = !a[j];
if ((s == i && (t > i || t == -1))
|| ((s > i || s == -1) && t == i))
r = m;
else
l = m;
}
b[l] = i;
if (s == i) a[l] = !a[l], s = -2;
}
answer (&a[0], &b[0]);
}
# | 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... |