#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(a,b) for(long long a = 0;a < b;++a) int main() { long long x_low = 1; long long x_high = 1000000000; int cnt = 0; while (cnt != 100) { cnt++; long long hoge = (x_high+x_low) / 2; cout << "? "<< hoge << endl; int a = 0; cin >> a; if (a == 0) { x_high = hoge; } else { x_low = hoge; } } cout << "! " << x_low << endl; }