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 "prize.h"
#include <bits/stdc++.h>
using namespace std;
int res = -1;
void q(int l,int r){
if(l>=r)return;
if(res != -1)return;
int m = (l+r)/2;
vector<int> rp = ask(m);
if(rp[0]+rp[1] == 0){
res = m;
return;
}
if(rp[0] > 0){
q(l,m);
}
if(rp[1] > 0){
q(m+1,r);
}
}
int find_best(int n) {
q(0,n);
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |