#include #include #include #include #include #include #include char S[10]; bool ask(const int v, int& t){ --t; std::cout << "? " << v << '\n'; std::cin >> S; return S[0] == 's'; } int main(void){ int ok = 0, ng = 1000; int ask_t = 25; while(ng - ok > 1){ const int mid = (ok + ng) / 2; if(ask(mid, ask_t)) ok = mid; else{ if(ask(mid + 1, ask_t)) ok = mid + 1; else ng = mid; } if(ask_t > 25) return 1; } std::cout << ok << '\n'; return 0; }