結果

問題 No.246 質問と回答
ユーザー kano_townkano_town
提出日時 2015-07-17 23:14:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 3,449 ms
コンパイル使用メモリ 73,172 KB
実行使用メモリ 72,648 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 19:56:40
合計ジャッジ時間 11,228 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 197 ms
71,908 KB
testcase_01 AC 194 ms
72,068 KB
testcase_02 AC 195 ms
71,672 KB
testcase_03 AC 193 ms
71,984 KB
testcase_04 AC 193 ms
72,268 KB
testcase_05 AC 194 ms
71,992 KB
testcase_06 AC 193 ms
71,860 KB
testcase_07 AC 196 ms
71,816 KB
testcase_08 AC 193 ms
71,808 KB
testcase_09 AC 197 ms
72,148 KB
testcase_10 AC 192 ms
71,568 KB
testcase_11 AC 193 ms
70,040 KB
testcase_12 AC 198 ms
72,296 KB
testcase_13 AC 193 ms
72,156 KB
testcase_14 AC 194 ms
71,936 KB
testcase_15 AC 194 ms
69,992 KB
testcase_16 AC 195 ms
71,404 KB
testcase_17 AC 193 ms
72,648 KB
testcase_18 AC 193 ms
72,196 KB
testcase_19 AC 193 ms
71,684 KB
testcase_20 AC 193 ms
71,292 KB
testcase_21 AC 194 ms
72,292 KB
testcase_22 AC 194 ms
72,416 KB
testcase_23 AC 178 ms
69,904 KB
testcase_24 AC 193 ms
71,900 KB
testcase_25 AC 192 ms
71,780 KB
testcase_26 AC 192 ms
71,672 KB
testcase_27 AC 191 ms
71,696 KB
testcase_28 AC 193 ms
71,752 KB
testcase_29 AC 194 ms
72,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder246 {

    public static void main(String[] args) {
        int min = 0, max = 1000000000, mid;
        Scanner sc = new Scanner(System.in);
        while (Math.abs(max-min) > 1) {
            mid = (max + min) / 2;
            System.out.println("? " + mid);
            if (sc.nextInt() == 1) min = mid;
            else max = mid;
        }
        System.out.println("! " + min);
    }
}
0