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];
int min_segment(int l,int r){
int mid=(l+r)>>1;
vector<int>a = ask(mid);
if(a[0] == 0 && a[1] == 0){
return mid;
}
if(l==r){
return 0;
}
int tmp1=min_segment(l,max(l,mid-1));
int tmp2=min_segment(min(r,mid+1),r);
return max(tmp1,tmp2);
}
int find_best(int n) {
return min_segment(0,n-1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |