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;
int S[5000],D[5000];
void exploreCave(int N) {
int i,j;
for(i=0;i<N;i++) D[i]=-1;
for(i=0;i<N;i++){
bool t=tryCombination(S)==i;
int l=0,r=N-1,mid;
while(r>l){
mid=(r+l)/2;
for(j=l;j<=mid;j++){
if(D[j]==-1) S[j]=1-S[j];
}
if((tryCombination(S)==i)==t) l=mid+1;
else r=mid;
for(j=l;j<=mid;j++){
if(D[j]==-1) S[j]=1-S[j];
}
}
if(t) S[r]=1-S[r];
D[r]=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... |