# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232005 | Coroian_David | Hotter Colder (IOI10_hottercolder) | C++11 | 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 "grader.h"
int cautBin()
{
///VARIANTA CEA MAI PENALA DOAMNE
///Guess(st) and Guess(dr) fail because when we have 1 500 and 250 or 1 6 and 3
/// it will not give the right number, it makes no use of the same answer
int st = 1;
int dr = DR;
while(st < dr)
{
if(st == 1 && dr == 2)
{
Guess(1);
int x = Guess(2);
return (x == 1 ? 2 : 1);
}
int mid = (st + dr) >> 1;
Guess(mid - 1);
int x = Guess(mid + 1);
if(x == 0)
return mid;
if(x == 1)
st = mid + 1;
else
dr = mid - 1;
}
return st;
}