結果

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

テストケース

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

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