# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29843 | ozaslan | Cave (IOI13_cave) | C++14 | 7 ms | 512 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"
#define max_N 5005
int kul[max_N], S[max_N], D[max_N];
void exploreCave(int N) {
for (int i = 0; i < N; i++) {
int kapi = tryCombination(S);
if (kapi > i || kapi == -1)
for (int j = 0; j < N; j++)
if (!kul[j]) {
S[j] = 1;
kapi = tryCombination(S);
if (kapi == i) {
S[j] = 0;
D[j] = i;
kul[j] = 1;
break;
}
else
S[j] = 0;
}
else
for (int j = 0; j < N; j++)
if (!kul[j]) {
S[j] = 1;
kapi = tryCombination(S);
if (kapi > i || kapi == -1) {
D[j] = i;
kul[j] = 1;
break;
}
else
S[j] = 0;
}
}
answer(S, D);
}
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... |