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;
int S[5005],D[5005];
void exploreCave(int N) {
for(int i = 0; i < N; ++i) S[i] = 0;
for(int i = 0; i < N; ++i){
bool fl = (i == tryCombination(S));
int l = 0, r = N-1;
while(r != l){
int md = (l+r)>>1;
int kl = l, kr = md;
for(int j = l; j <= md; ++j) S[j] = 1-S[j];
bool gl = (i == tryCombination(S));
if(fl == gl) l = md+1;
else r = md;
for(int j = kl; j <= kr; ++j) S[j] = 1-S[j];
}
if(fl) S[l] = 1-S[l];
D[l] = i;
}
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... |