#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,e) for (int i = s; i <= e; ++i)
#define rrep(i,s,e) for (int i = s; i >= e; --i)
#define fi first
#define se second
#define pb push_back
typedef vector<int> vi;
typedef pair<int,int> ii;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
int x = 1, y = n+1, tp = 1;
while (y>x) {
if (tp) {
cout << "? " << x << endl;
y--;
}
else {
cout << "? " << y << endl;
x++;
}
int res; cin >> res;
if (res==0) break;
tp ^= 1;
}
cout << "= " <<y-x+1 << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong guess |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong guess |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong guess |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong guess |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong guess |
2 |
Halted |
0 ms |
0 KB |
- |