# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
992833 | mohammedMonem | Cave (IOI13_cave) | C++14 | 0 ms | 0 KiB |
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];
memset(comp, 0, N);
bool try1 = tryCombination(comp);
if (try1 > 0) {
memset(comp, 1, N);
try1 = tryCombination(comp);
}
int *v(N);
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
comp[i] = !comp[i];
bool try2 = tryCombination(comp);
if (try1 != try2) {
v[i] = j;
try1 = try2;
break;
}
comp[i] = !comp[i];
}
}
answer(v, comp);
}