# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
753492 | amirrezashams | Guess the number (BOI20_guess) | C++14 | 1 ms | 208 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 <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
int start = 1;
int end = a;
while(true)
{
int mid = (end+start)/2;
cout << "? "<<mid;
int r;
cin >> r;
if(r==0)
{
cout << "= "<<mid;
break;
}
if(r==1)
end = mid;
if(r==-1)
start = mid;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |