# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
611408 | Shithila | The Big Prize (IOI17_prize) | C++14 | 82 ms | 296 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 "prize.h"
int find_best(int n) {
int start=0;
int end=n-1;
int found=false;
while(found==false)
{
int check=start+end;
check=check/2;
std::vector<int> res = ask(check);
if(res[0]==0 && res[1]==0)
{
return check;
found==true;
}
else if(res[0]==1)
{
end=check;
}
else if(res[1]==1)
{
start=check;
}
if(start==end-1)
{
if(check==start)
{
return end;
found==true;
}
else
{
return start;
found==true;
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |