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;
#define f0(i, n) for (int i = 0; i < (n); ++i)
#define f1(i, n) for (int i = 1; i <= (n); ++i)
void exploreCave(int N) {
/* ... */
int S[N], D[N], dr;
bool DK[N], on;
memset(DK, 0, sizeof(DK));
memset(S, -1, sizeof(S));
memset(D, -1, sizeof(D));
f0(door, N) {
f0(i, N) {
if(DK[i]) continue;
S[i] = 1;
}
dr = tryCombination(S);
if(dr > door || dr == -1) {
on = 1;
} else {
on = 0;
}
// cout << on << endl;
int key = 0;
f0(bit, 3) {
f0(i, N) {
if(DK[i]) continue;
if(i & (1 << bit)) {
S[i] = on;
} else {
S[i] = (1-on);
}
}
// f0(i, N) cout << S[i] << " "; cout << endl;
dr = tryCombination(S);
if(dr > door || dr == -1) {
key |= (1 << bit);
// cout << bit << " " << dr << endl;
}
}
// cout << key << " " << door << endl;
D[key] = door;
DK[key] = true;
S[key] = on;
}
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... |