#include <bits/stdc++.h>
#define ll long long
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define fr first
#define se second
using namespace std;
vector<int> ask(int i);
int find_best(int n) {
ll l=0, r=n-1, piv, pos=0;
vector<int>a;
while(l<=r)
{
piv=(l+r)/2;
a=ask(piv);
if(a[0]==0&&a[1]==0)
{
pos=piv;
break;
}
if(a[0]==1)
r=piv-1;
else
l=piv+1;
}
return pos;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |