結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
24,040 KB
testcase_01 AC 35 ms
23,448 KB
testcase_02 AC 34 ms
23,640 KB
testcase_03 AC 35 ms
23,388 KB
testcase_04 WA -
testcase_05 AC 36 ms
24,276 KB
testcase_06 AC 36 ms
24,060 KB
testcase_07 AC 38 ms
23,568 KB
testcase_08 AC 36 ms
23,448 KB
testcase_09 WA -
testcase_10 AC 35 ms
24,300 KB
testcase_11 AC 36 ms
24,396 KB
testcase_12 AC 38 ms
23,532 KB
testcase_13 AC 37 ms
23,568 KB
testcase_14 WA -
testcase_15 AC 38 ms
24,384 KB
testcase_16 AC 36 ms
23,448 KB
testcase_17 AC 37 ms
23,652 KB
testcase_18 AC 36 ms
24,036 KB
testcase_19 WA -
testcase_20 AC 37 ms
23,556 KB
testcase_21 AC 38 ms
23,424 KB
testcase_22 WA -
testcase_23 AC 35 ms
23,664 KB
testcase_24 AC 37 ms
23,832 KB
testcase_25 AC 35 ms
23,832 KB
testcase_26 AC 38 ms
24,504 KB
testcase_27 AC 35 ms
23,412 KB
testcase_28 AC 36 ms
23,652 KB
testcase_29 AC 35 ms
24,048 KB
testcase_30 AC 36 ms
23,532 KB
testcase_31 AC 36 ms
23,652 KB
testcase_32 AC 37 ms
23,532 KB
testcase_33 AC 37 ms
23,676 KB
testcase_34 WA -
testcase_35 AC 36 ms
24,276 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 + 1
    if reply == -1:
        r = x - 1
    if reply == 0:
        puts("! %d" % (x + i))
        break

    l, r = max(0, l - 1), max(0, r - 1)
0