#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int n) {
int s[n];
int d[n];
int finalS[n];
bool used[n];
fill(s, s + n, 0);
fill(used, used + n, false);
for (int puerta = 0; puerta < n; puerta++) {
int original = tryCombination(s);
for (int j = 0; j < n; j++) {
if (used[j]) continue;
s[j] ^= 1;
int nuevo = tryCombination(s);
s[j] ^= 1;
if (nuevo != original) {
d[j] = puerta;
finalS[j] = (nuevo == puerta) ? s[j] ^ 1 : s[j];
s[j] = finalS[j];
used[j] = true;
break;
}
}
}
answer(finalS, 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... |