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 comp[N], cmp[N] = {0}, v[N];
for (int i = 0; i < N; ++i) {
memset(comp, 0, N);
if (tryCombination(comp)) {
memset(comp, 1, N);
}
int s = 0, e = N - 1;
while (s <= e) {
int md = (s + e) / 2;
memset(comp + s, !comp[s], md);
if (tryCombination(comp) == i) {
v[i] = s, cmp[i] = comp[s];
e = md - 1;
} else {
s = md + 1;
}
memset(comp + s, !comp[s], md);
}
}
answer(cmp, v);
}
# | 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... |