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>
using namespace std;
#include "prize.h"
const int mx=2e6+5;
int tree[mx*4],say=0;
int min_segment(int l,int r){
if(l>r){
return -1;
}
int mid=(l+r)>>1;
vector<int>a = ask(mid);
if(a[0] == 0 && a[1] == 0){
return mid;
}
if(l==r){
return -1;
}
int tmp1=min_segment(l,mid-1);
if(tmp1!=-1){
return tmp1;
}
int tmp2=min_segment(mid+1,r);
if(tmp2!=-1){
return tmp2;
}
return -1;
}
int find_best(int n) {
return max(0,min_segment(0,n-1));
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |