結果

問題 No.253 ロウソクの長さ
ユーザー finefine
提出日時 2016-04-05 01:07:07
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 31,472 KB
平均クエリ数 30.58
最終ジャッジ日時 2023-09-23 10:16:28
合計ジャッジ時間 6,716 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
31,120 KB
testcase_01 AC 105 ms
30,816 KB
testcase_02 AC 105 ms
31,036 KB
testcase_03 AC 107 ms
30,808 KB
testcase_04 WA -
testcase_05 AC 105 ms
30,944 KB
testcase_06 AC 107 ms
30,740 KB
testcase_07 AC 104 ms
30,952 KB
testcase_08 AC 104 ms
30,920 KB
testcase_09 WA -
testcase_10 AC 103 ms
30,884 KB
testcase_11 AC 104 ms
30,836 KB
testcase_12 AC 104 ms
31,140 KB
testcase_13 AC 103 ms
31,096 KB
testcase_14 WA -
testcase_15 AC 103 ms
31,076 KB
testcase_16 AC 104 ms
31,304 KB
testcase_17 AC 103 ms
31,144 KB
testcase_18 AC 120 ms
31,060 KB
testcase_19 WA -
testcase_20 AC 105 ms
31,064 KB
testcase_21 AC 103 ms
30,764 KB
testcase_22 WA -
testcase_23 AC 105 ms
30,624 KB
testcase_24 AC 104 ms
30,860 KB
testcase_25 AC 107 ms
31,192 KB
testcase_26 AC 105 ms
31,440 KB
testcase_27 AC 105 ms
31,292 KB
testcase_28 AC 102 ms
30,812 KB
testcase_29 AC 102 ms
31,264 KB
testcase_30 AC 104 ms
30,844 KB
testcase_31 AC 105 ms
31,412 KB
testcase_32 AC 103 ms
31,472 KB
testcase_33 AC 103 ms
31,312 KB
testcase_34 WA -
testcase_35 AC 105 ms
30,716 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

l = 10
r = 1000000001
c = 0
loop{
    y = (l + r) / 2
    puts "? #{y}"
    STDOUT.flush
    ans = gets.to_i
    if ans == 0
        puts "! #{y + c}"
        STDOUT.flush
        break
    elsif ans > 0
        l = y
    else
        r = y
    end
    #r = [r - 1,0].max
    l = [l - 1,0].max
    c += 1
    }
0