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 <iostream>
using namespace std;
void exploreCave(int N) {
static int ANS1[5000] = {}, ANS2[5000] = {}; //ANS1:Switch ANS2:Door
static int Q[14][5000] = {};
for (int i = 0; i < N; i++) {
for (int j = 0; j < 14; j++) {
Q[j][i] = (i >> j) & 1;
}
}
for (int i = 0; i < N; i++) {
/*for (int j = 0; j < 14; j++) {
for (int k = 0; k < N; k++) cout << Q[j][k] << ' ';
cout << endl;
}
cout << endl;*/
int X = tryCombination(Q[13]);
int Y = 0;
for (int j = 0; j < 13; j++) {
if (tryCombination(Q[j]) > i) Y += 1 << j;
}
int A, B;
if (X == i) A = 1, B = Y;
else A = 0, B = 8191 - Y;
ANS1[B] = A, ANS2[B] = i;
for (int j = 0; j < 14; j++) {
Q[j][B] = A;
}
}
answer(ANS1, ANS2);
}
# | 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... |