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;
#define FOR(i, x, y) for (int i = x; i < y; i++)
void exploreCave(int n){
int door[n], move[n], use[n] = {};
FOR(i, 0, n){
int openI, L = 0, H = n - 1;
FOR(j, 0, n) if (!use[j]) move[j] = 0;
openI = (tryCombination(move) == i);
while (L < H){
int M = (L + H) / 2;
FOR(j, 0, n) if (!use[j]) move[j] = openI ^ (j >= L and j <= M);
(tryCombination(move) == i) ? (H = M) : (L = M + 1);
}
door[L] = i; move[L] = openI; use[L] = 1;
}
answer(move, door);
}
# | 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... |