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;
void exploreCave(int N){
int s[N],d[N];
for (int i=0; i<N; i++){
s[i]=0;
d[i]=-1;
}
vector <int> ret;
for (int i=0; i<N; i++){
ret.push_back(tryCombination(s));
int l=0,r=N-1;
while (l<r){
int mid=(l+r)/2;
for (int j=l; j<mid; j++){
if (d[j]==-1) s[j]^=1;
}
bool a=(ret.back()==i);
ret.push_back(tryCombination(s));
bool b=(ret.back()==i);
if (a^b) r=mid;
else l=mid+1;
}
if (ret.back()==i) s[l]^=1;
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... |