#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" #define REP(i,a,b) for(int i=a;i Y) cerr << 1; if (length == Y) cerr << 0; cerr << endl; length--; } void ans(int Y) { cout << "! " << Y << endl; exit(0); } signed main() { int cnt = 0; int left = 0, right = INT_MAX; rep(i, 30) { question(1 << i); int res; cin >> res; if (res == 0) ans((1 << i) + i); if (res == -1) { right = (1 << i) - 1; cnt = i + 1; break; } } if (right == INT_MAX) cnt = 30; rep(i, 1000) { int mid = (left + right) / 2; dump(left); dump(right); dump(mid); question(mid); int res; cin >> res; if (res == -1) { right = mid; } if (res == 1) { left = mid; } if (res == 0) { ans(mid + i + cnt); } left--; right--; } return 0; }