結果

問題 No.246 質問と回答
ユーザー 小指が強い人小指が強い人
提出日時 2015-11-15 17:44:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 11,204 KB
実行使用メモリ 31,456 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 20:08:59
合計ジャッジ時間 5,319 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
31,176 KB
testcase_01 AC 113 ms
31,132 KB
testcase_02 AC 116 ms
30,860 KB
testcase_03 AC 116 ms
30,480 KB
testcase_04 AC 113 ms
30,904 KB
testcase_05 AC 116 ms
30,868 KB
testcase_06 AC 116 ms
30,800 KB
testcase_07 AC 117 ms
30,856 KB
testcase_08 AC 113 ms
30,644 KB
testcase_09 AC 114 ms
30,828 KB
testcase_10 AC 113 ms
30,896 KB
testcase_11 AC 115 ms
30,968 KB
testcase_12 AC 113 ms
31,140 KB
testcase_13 AC 113 ms
31,032 KB
testcase_14 AC 112 ms
31,180 KB
testcase_15 AC 114 ms
30,900 KB
testcase_16 AC 115 ms
30,920 KB
testcase_17 AC 111 ms
30,744 KB
testcase_18 AC 111 ms
30,996 KB
testcase_19 AC 111 ms
30,552 KB
testcase_20 AC 111 ms
30,892 KB
testcase_21 AC 111 ms
30,752 KB
testcase_22 AC 115 ms
30,972 KB
testcase_23 AC 115 ms
30,960 KB
testcase_24 AC 111 ms
30,944 KB
testcase_25 AC 114 ms
31,176 KB
testcase_26 AC 109 ms
31,456 KB
testcase_27 AC 110 ms
30,752 KB
testcase_28 AC 111 ms
30,852 KB
testcase_29 AC 114 ms
30,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

rmin = 1
rmax = 10 ** 9
while rmin <= rmax do
    mid = (rmin + rmax) / 2
    print "? ", mid, "\n"
    STDOUT.flush
    if gets.to_i == 1
        rmin = mid + 1
    else
        rmax = mid - 1
    end
end
print "! ", rmin - 1, "\n"
STDOUT.flush
0