# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
670699 | birthdaycake | 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"
using namespace std;
int vs[101],val[101],sw[101];
void exploreCave(int N) {
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(!vs[j]){
val[j] = 0;
}
}
int x = tryCombination(val), what = 0;
if(x == i + 1) what = 1;
for(int j = 0; j < n; j++){
if(!vs[j]){
val[j] = !what;
}
}
for(int j = 0; j < n; j++){
if(!vs[j]){
val[j] = what;
int ii = tryCombination(val);
if(ii > i + 1){
sw[j] = i + 1;
vs[j] = 1;
break;
}
val[j] = !what;
}
}
}
answer(val, sw);
}