# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974770 | HasanV11010238 | Cave (IOI13_cave) | C++17 | 16 ms | 568 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"
int f(int N, int ar[], int cl[]){
int anscl[N];
for (int i = 0; i < N; i++){
anscl[i] = 1 - cl[i];
if (ar[i] == -1){
cl[i] = 1 - cl[i];
ar[i] = tryCombination(cl);
cl[i] = 1 - cl[i];
}
}
answer(cl, ar);
}
void exploreCave(int N) {
int ar[N], cl[N];
for (int i = 0; i < N; i++){
cl[i] = 0;
ar[i] = -1;
}
int def = 0, bes = tryCombination(cl);
for (int in = 0; bes != -1; in++){
int i = in % N;
if (ar[i] == -1){
cl[i] = 1 - cl[i];
int tr = tryCombination(cl);
if (tr > bes || tr == -1){
ar[i] = bes;
bes = tr;
}
else if (tr == bes){
cl[i] = 1 - cl[i];
}
else{
ar[i] = tr;
cl[i] = 1 - cl[i];
}
}
}
f(N, ar, cl);
}
Compilation message (stderr)
# | 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... |