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