結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
30,984 KB
testcase_01 AC 122 ms
30,860 KB
testcase_02 AC 121 ms
31,108 KB
testcase_03 AC 123 ms
31,116 KB
testcase_04 AC 122 ms
31,024 KB
testcase_05 AC 122 ms
30,980 KB
testcase_06 AC 121 ms
30,656 KB
testcase_07 AC 121 ms
30,972 KB
testcase_08 AC 123 ms
31,440 KB
testcase_09 AC 122 ms
30,864 KB
testcase_10 AC 122 ms
31,240 KB
testcase_11 AC 123 ms
31,236 KB
testcase_12 AC 120 ms
31,140 KB
testcase_13 AC 120 ms
30,928 KB
testcase_14 AC 119 ms
30,664 KB
testcase_15 AC 122 ms
30,788 KB
testcase_16 AC 119 ms
31,080 KB
testcase_17 AC 118 ms
30,576 KB
testcase_18 AC 119 ms
31,260 KB
testcase_19 AC 118 ms
31,264 KB
testcase_20 AC 121 ms
30,676 KB
testcase_21 AC 118 ms
30,844 KB
testcase_22 AC 119 ms
31,004 KB
testcase_23 AC 118 ms
31,388 KB
testcase_24 AC 119 ms
31,268 KB
testcase_25 AC 120 ms
31,324 KB
testcase_26 AC 123 ms
31,096 KB
testcase_27 AC 121 ms
30,760 KB
testcase_28 AC 122 ms
30,768 KB
testcase_29 AC 121 ms
30,608 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