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 D[N];
int CS[N];
bool found[N]{};
for (int doorN = 0; doorN < N; doorN++) {
int res = 0;
int S[N]{};
for (int n = 0; n < N; n++) if (found[n]) S[n] = CS[n];
bool type = (tryCombination(S) == doorN);
for (int i = 1; i < N; i *= 2) {
int S[N];
for (int n = 0; n < N; n++) {
S[n] = (n%(2*i) < i ? 0 : 1);
if (found[n]) S[n] = CS[n];
}
if ((type && tryCombination(S) != doorN) || (!type && tryCombination(S) == doorN)) res += i;
}
D[res] = doorN;
found[res] = true;
CS[res] = type;
}
answer(CS, 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... |