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;
void exploreCave(int n) {
int v[n],d[n],s[n];
memset(v, 0, sizeof v);
memset(d, 0, sizeof d);
memset(s, 0, sizeof s);
if(tryCombination(d) == -1 && n > 100){
for(int i = 0; i < n; i++){
d[i] = 1;
s[i] = tryCombination(s);
d[i] = 0;
}
answer(d, s);
return;
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(!v[j]){
d[j] = 0;
}
}
int x = tryCombination(d), what = 0;
if(x == i) what = 1;
for(int j = 0; j < n; j++){
if(!v[j]){
d[j] = !what;
}
}
for(int j = 0; j < n; j++){
if(!v[j]){
d[j] = what;
int ii = tryCombination(d);
if(ii == -1 or ii > i){
s[j] = i;
v[j] = 1;
break;
}
d[j] = !what;
}
}
}
answer(d, s);
}
# | 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... |