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>
#include "prize.h"
#define N 100005
#define ll long long int
#define fo(i,x,y) for(int i=x;i<=y;i++)
#define fs(ar,n) fo(i,1,n) cin>>ar[i]
#define sp " "
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast2 freopen ("in.txt","r",stdin);freopen ("out.txt","w",stdout);
#define mod 1000000007
using namespace std;
ll nn,m,ar[N],sum,t,a,b,ans;
vector<int> myask(int ind)
{
vector<int> a=ask(ind);
if(a[0]==0 && a[1]==0)
ans=ind;
return a;
}
void bs(ll l,ll r,vector<int> v1,vector<int> v2)
{
if(ans!=-1)
return;
if(v1[0]==v2[0] && v1[1]==v2[1])
return;
if(r-l<=1)
return;
int mid=(l+r)/2;
vector<int> v3;
v3=myask(mid);
bs(l,mid,v1,v3);
bs(mid,r,v3,v2);
}
int find_best(int n)
{
a=0;
b=n-1;
ans=-1;
bs(0,n-1,myask(0),myask(n-1));
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |