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>
void exploreCave(int N)
{
int s[N], d[N];
memset(s, 0, sizeof(s));
for (int i = 0; i < N; i++)
{
int x = tryCombination(s);
int l, r;
l = 0, r = N - 1;
while (l < r)
{
int m = (l + r) / 2;
s[m] = 1 - s[m];
int y = tryCombination(s);
if (y == x)
{
l = m;
}
else
{
r = m;
}
s[m] = 1 - s[m];
}
d[l] = x;
s[l] = 1 - s[l];
}
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... |