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;
using ll = long long;
bool ask(ll x) {
cout << "? " << x << endl;
cin >> x; return x;
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
ll n;
cin >> n;
ask(1);
ll l = 1, r = n;
while (l < r) {
ll mid = (l + r) / 2;
if (ask(mid + 1)) r = mid;
else l = mid + 1;
ask(1);
}
cout << "= " << l << endl;
return 0;
}
# | 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... |