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 S[N],D[N];
for(int i = 0; i < N; i++) {
S[i] = 0;
D[i] = -1;
}
for(int k = 0; k < N; k++) {
int index = tryCombination(S);
if(index == -1) break;
for(int j = 0; j < N; j++) {
if(D[j] != -1) continue;
S[j] ^= 1;
if(tryCombination(S) != index) {
D[j] = index;
break;
}
S[j] ^= 1;
}
}
int SS[N];
for(int i = 0; i < N; i++) {
SS[i] = 1;
}
for(int k = 0; k < N; k++) {
int index = tryCombination(SS);
if(index == -1) break;
for(int j = 0; j < N; j++) {
if(D[j] != -1) continue;
SS[j] ^= 1;
if(tryCombination(SS) != index) {
D[j] = index;
break;
}
SS[j] ^= 1;
}
}
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... |