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;
int a[5010];
int ans[5010];
int che[5010];
void exploreCave(int n) {
for(int i=0;i<n;i++){
for(int ii=0;ii<n;i++){
if(che[ii]==0){
a[ii]=1;
}
}
int ret=tryCombination(a);
int l=0;
int r=n-1;
while(l<r){
int mid=(l+r)/2;
for(int ii=l;ii<=mid;ii++){
if(che[ii]==0)
a[ii]=1;
}
for(int ii=mid+1;ii<=r;ii++){
if(che[ii]==0)
a[ii]=0;
}
int res=tryCombination(a);
if((ret==i&&res==i)||(ret!=i&&res!=i)){
r=mid;
}
else
l=mid+1;
}
che[l]=1;
ans[l]=i;
if(ret==i)
a[l]=0;
else
a[l]=1;
}
answer(a,ans);
}
# | 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... |