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 s[5005],d[5005];
bitset<5005> found(0);
void exploreCave(int n) {
for(int cur=0;cur<n;cur++){
for(int i=0;i<n;i++)
if(!found[i])
s[i]=0;
int tt=tryCombination(s);
int cr=0;
if(tt==cur)
cr=1;
for(int i=0;i<n;i++)
if(!found[i])
s[i]=cr;
int l=0,r=n-1;
while(l<r){
int m=(l+r)/2;
for(int i=0;i<m;i++)
if(!found[i])
s[i]=!cr;
tt=tryCombination(s);
for(int i=0;i<n;i++)
s[i]=cr;
if(tt==cur)
r=m;
else
l=m+1;
}
d[l]=cur;
s[l]=cr;
found[l]=1;
}
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... |