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"
#define DEBUG 0
using namespace std;
const int MX = 5e3 + 10;
int S[MX], D[MX], res, res1;
void exploreCave(int N) {
for(int i = 0; i < N; i++) {
D[i] = -1;
}
// Subtask 1
// for(int i = 0; i < N; i++) {
// res = tryCombination(S);
// if(res == i) {
// S[i] = 1;
// }
// else {
// S[i] = 0;
// }
// }
// for(int i = 0; i < N; i++) {
// D[i] = i;
// }
// answer(S, D);
// Subtask 2
// for(int i = 0; i < N; i++) {
// S[i] = 1;
// res = tryCombination(S);
// D[i] = res;
// S[i] = 0;
// }
// answer(S, D);
// Subtask 3
for(int i = 0; i < N; i++) {
res1 = tryCombination(S);
for(int j = 0; j < N; j++) {
if(D[j] != -1) {
continue;
}
S[j] = 1;
res = tryCombination(S);
if(res1 == i and res != i) {
D[j] = i;
break;
}
if(res1 != i and res == i) {
S[j] = 0;
D[j] = i;
break;
}
S[j] = 0;
}
}
answer(S, D);
}
# | 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... |