# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1105144 | jadai007 | Cave (IOI13_cave) | C++17 | 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 state[MAX_N] = {0}, link[MAX_N] = {0}, inv[MAX_N] = {0};
for(int i = 0; i < N; ++i){
int ft = tryCombination(state);
state[i] = 1;
int nd = tryCombination(state);
if(ft == -1){
state[i] = 0;
break;
}
else if(nd == -1) break;
else if(ft != nd) state[i] = 0;
}
for(int i = 0; i < N; ++i){
state[i] = !state[i];
int ck = tryCombination(state);
link[i] = ck;
state[i] = !state[i];
}
answer(state, link);
}