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 "graderlib.c"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int n)
{
int a[n], d[n];
vector<int> used(n, -1);
for (int i = 0; i < n; i++)
{
int l = 0, r = n - 1;
while (l < r)
{
int m = (l + r) >> 1;
for (int j = l; j < r; j++)
{
if (used[j] == -1)
a[j] = 0;
else
a[j] = used[j];
}
for (int j = 0; j < l; j++)
a[j] = used[j];
for (int j = r; j < n; j++)
a[j] = used[j];
int k = tryCombination(a);
if (k == i)
l = m + 1;
else
r = m;
}
d[i] = l;
used[i] = a[i];
}
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... |