# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89999 | nikolapesic2802 | The Big Prize (IOI17_prize) | C++14 | 0 ms | 0 KiB |
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"
using namespace std;
int doit(int l,int r)
{
int m=(l+r)>>1;
vector<int> tr=ask(m);
if(tr[0]+tr[1]==0)
return m;
if(l==r)
return -1;
if(tr[0]>tr[1])
{
int tr=doit(l,m-1);
if(tr!=-1)
return tr;
return doit(m+1,r);
}
else
{
int tr=doit(m+1,r);
if(tr!=-1)
return tr;
return doit(l,m-1);
}
}