#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll N, X, L, R, mid, tot = 0, tmp = 1, S;
int main () {
cin >> N;
L = 1;
R = N;
tmp = 1;
while(L < R) {
mid = (L+R)/2;
tot += mid*tmp;
tmp *= -1;
X = max(X, 1-tot);
L = mid+1;
}
cout << "? " << X << endl;
cin >> S;
L = 1;
R = N;
tmp = 1;
while(L < R) {
mid = (L+R)/2;
X += mid*tmp;
tmp *= -1;
cout << "? " << X << endl;
cin >> S;
if (S==1) R = mid;
else L = mid+1;
}
cout << "= " << L << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |