#include #include #include #include #include #include #include #include #include using namespace std; #pragma warning (disable: 4996) int main() { int cl = 1, cr = 1005, cm, maxn = 0; for (int i = 0; i < 12; i++) { cm = (cl + cr) / 2; cout << "? " << cm + 0 << endl; string t1; cin >> t1; cout << "? " << cm + 1 << endl; string t2; cin >> t2; if (t1 == "safe") maxn = max(maxn, cm + 0); if (t2 == "safe") maxn = max(maxn, cm + 1); if (t1 == "out" && t2 == "out") { cr = cm; } else { cl = cm; } } cout << "! " << maxn << endl; return 0; }