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"
int a[5010],b[5010],chk[5010];
void exploreCave(int n){
int i,j,s,e,m,t,p;
for(i=0;i<n;++i){
t=tryCombination(a);
s=0,e=n-1;
while(s<e){
m=(s+e)/2;
for(j=s;j<=m;++j)if(!chk[j])a[j]=!a[j];
p=t,t=tryCombination(a);
(p==i)^(t==i)?e=m:s=m+1;
}
if(t==i)a[s]=!a[s];
b[s]=i,chk[s]=1;
}
answer(a,b);
}
# | 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... |