#include #include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max() / 32 * 15 + 208; int main() { int t = 8; int a = 0; while(true){ cout << "? " << max(t-a, 0) << endl; a++; int x; cin >> x; if(!x) { cout << "! " << t << "\n"; return 0; } if(x < 0) break; t *= 2; } int ok = t/2, ng = t; while(ng-ok > 1){ int mid = (ok+ng)/2; cout << "? " << max(mid-a, 0) << endl; int x; cin >> x; if(!x) { cout << "! " << mid << endl; return 0; } (x == 1 ? ok : ng) = mid; a++; } cout << "! " << ok << endl; return 0; }