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 find_best(int n) {
int low = -1 , high = n;
int ans = -1;
while(high - low > 0)
{
int mid = (low + high) >> 1;
auto res = ask(mid);
if(res[0] + res[1] == 0)
{
ans = mid;
break;
}
if(res[0] == 0)
low = mid;
else
high = mid;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |