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()
{
ios::sync_with_stdio(false);cin.tie(NULL);
int n;
cin >> n;
cout << "? 1" << endl;
int ans;
cin >> ans;
for(int i=2;i<=n;i++){
if(i%2 == 0) cout << "? " << n - i/2 + 1 << endl;
else cout << "? " << i/2 + 1 << endl;
cin >> ans;
if(ans == 0){
cout << "= " << n - i + 2;
return 0;
}
}
cout << "= 1";
}
# | 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... |