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;
long long N;
int main() {
// Step #1. Input
cin >> N;
// Step #2. Get Answer
int ret = N;
int cl = 1, cr = N;
for (int i = 1; i <= N; i++) {
if (i % 2 == 1) { cout << "? " << cl << endl; cl += 1; }
if (i % 2 == 0) { cout << "? " << cr << endl; cr -= 1; }
int x; cin >> x;
if (i >= 2 && x == 1) { ret = N - i + 1; }
}
cout << "= " << ret << 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... |