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>
using namespace std;
typedef long long ll;
int main(){
ll n;
cin >> n;
ll lo = 1, hi = n, mid = -1;
while(lo <= hi){
mid = (lo + hi)/2;
cout << "?" << ' ' << mid << endl;
ll x;
cin >> x;
if(x == 1){
hi = mid - 1;
} else{
lo = mid + 1;
}
}
cout << "=" << ' ' << mid;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |