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"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
/* ... */
int Key[N];
bool isSuccess[N];
for (int i = 0; i < N; i++) {
Key[i] = 0;
isSuccess[i] = 0;
}
int ansS[N], ansD[N];
for (int i = 0; i < N; i++) {
int value = tryCombination(Key);
if (value > i || value == -1) {
for (int j = 0; j < N; j++) {
if (!isSuccess[j]) {
Key[j] = Key[j] ^ 1;
}
}
}
for (int j = 0; j < N; j++) {
if (isSuccess[j]) {
continue;
}
Key[j] = Key[j] ^ 1;
value = tryCombination(Key);
if (value > i || value == -1) {
ansD[j] = i;
ansS[j] = Key[j];
isSuccess[j] = 1;
break;
}
Key[j] = Key[j] ^ 1;
}
}
answer(ansS, ansD);
}
# | 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... |