using System; using System.Collections.Generic; class Program { //http://yukicoder.me/submissions/36416 ←参考にさせていただきました static void Main(string[] args) { int max = 100000000 + 1; int min = 0; while (max - min > 20) { int mid = (min + max) / 2; Console.WriteLine("? " + mid); if (int.Parse(Console.ReadLine()) == 1) { max = mid; } else { min = mid; } } int ans = max - min; bool waiting = false; while(true) { Console.WriteLine("? " + ans); if (int.Parse(Console.ReadLine()) == 1)//↓にある { if (waiting) { Console.WriteLine("! " + (ans - 2)); } else { ans -= 5; waiting = false; } } else { waiting = true; } } } }