import java.util.Scanner; public class Yuki_Reactive { public Yuki_Reactive() { Scanner scanner = new Scanner(System.in); int[] dummy = new int[100000000]; int A = 0; int B = (int) (1e+9) + 1; while (B - A > 1) { int c = (B + A) / 2; System.out.println("? " + c); // System.out.flush(); final int response = scanner.nextInt(); if (response == 1) { A = c; } else { B = c; } } System.out.println("! " + A ); System.out.flush(); } public static void main(String[] args) { Yuki_Reactive hoge = new Yuki_Reactive(); } }