# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1106385 | Nonbangkok | 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<bits/stdc++.h>
#include "cave.h"
void exploreCave(int N) {
int S[N], D[N], last=-2, start=0, closed;
for(int i=0;i<N;i++)S[i]=D[i]=0;
while(start!=N){
for(int i=start;i<N;i++){
int closed = tryCombination(S);
if(closed != last){
D[last] = i;
start++;
i = start;
last = closed;
continue;
}
S[i] = 1;
int closed = tryCombination(S);
if(closed != last){
D[last] = i;
start++;
i = start;
last = closed;
continue;
}
S[i] = 0;
}
}
answer(S,D);
}