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 cor[N], DtoS[N], StoD[N];
for(int i = 0; i < N; ++i) {
bool f = (tryCombination(cor) == i);
int tl = 0, tr = N - 1;
while(tl < tr) {
int tm = (tl + tr) / 2;
int ask[N];
for(int j = 0; j <= tm; ++j) {
ask[j] = 1;
}
for(int j = 0; j < i; ++j) ask[DtoS[j]] = cor[DtoS[j]];
bool F = (tryCombination(ask) == i);
if(F == f) {
tl = tm + 1;
} else tr = tm;
}
DtoS[i] = tl;
StoD[tl] = i;
cor[tl] = !f;
}
answer(cor, StoD);
}
# | 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... |