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"
int b_search(int l, int r) {
int mid = (l+r) >> 1;
std::vector<int> res = ask(mid);
if(!res[0] && !res[1]) return mid;
else if(res[0]) return b_search(l, mid-1);
else return b_search(mid+1, r);
}
int find_best(int n) {
return b_search(0, n-1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |