結果

問題 No.253 ロウソクの長さ
ユーザー roiti46roiti46
提出日時 2015-09-19 02:25:55
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 742 ms
コンパイル使用メモリ 6,724 KB
実行使用メモリ 24,396 KB
平均クエリ数 30.11
最終ジャッジ日時 2023-09-23 06:22:19
合計ジャッジ時間 4,173 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
24,396 KB
testcase_01 AC 36 ms
23,688 KB
testcase_02 AC 37 ms
23,424 KB
testcase_03 AC 35 ms
24,300 KB
testcase_04 WA -
testcase_05 AC 35 ms
23,448 KB
testcase_06 AC 35 ms
23,400 KB
testcase_07 AC 38 ms
23,412 KB
testcase_08 AC 35 ms
24,072 KB
testcase_09 WA -
testcase_10 AC 35 ms
24,384 KB
testcase_11 AC 34 ms
23,568 KB
testcase_12 AC 37 ms
23,448 KB
testcase_13 AC 35 ms
23,844 KB
testcase_14 WA -
testcase_15 AC 35 ms
24,288 KB
testcase_16 AC 34 ms
23,400 KB
testcase_17 AC 35 ms
23,736 KB
testcase_18 AC 34 ms
23,664 KB
testcase_19 WA -
testcase_20 AC 34 ms
24,060 KB
testcase_21 AC 35 ms
24,324 KB
testcase_22 WA -
testcase_23 AC 35 ms
24,396 KB
testcase_24 AC 35 ms
24,396 KB
testcase_25 AC 34 ms
24,048 KB
testcase_26 AC 34 ms
23,448 KB
testcase_27 AC 34 ms
23,568 KB
testcase_28 AC 35 ms
23,412 KB
testcase_29 AC 36 ms
23,664 KB
testcase_30 AC 35 ms
23,688 KB
testcase_31 AC 34 ms
24,060 KB
testcase_32 AC 35 ms
23,412 KB
testcase_33 AC 35 ms
23,652 KB
testcase_34 WA -
testcase_35 AC 35 ms
23,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def puts(s):
    print s
    sys.stdout.flush()

l, r = 10, 10 ** 9
for i in xrange(100):
    x = (l + r) / 2

    puts("? %d" % x)
    reply = int(raw_input())
    if reply == 1:
        l = x
        r -= 1
    if reply == -1:
        r = x - 1
        l = max(0, l - 1)
    if reply == 0:
        puts("! %d" % (x + i))
        break
0