結果

問題 No.253 ロウソクの長さ
ユーザー roiti46roiti46
提出日時 2015-09-19 02:26:39
言語 Python2
(2.7.18)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 6,648 KB
実行使用メモリ 24,456 KB
平均クエリ数 22.03
最終ジャッジ日時 2023-09-23 21:39:05
合計ジャッジ時間 4,099 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
23,652 KB
testcase_01 AC 48 ms
23,880 KB
testcase_02 AC 36 ms
23,616 KB
testcase_03 AC 34 ms
24,372 KB
testcase_04 AC 33 ms
23,424 KB
testcase_05 AC 34 ms
23,604 KB
testcase_06 AC 34 ms
24,456 KB
testcase_07 AC 35 ms
24,036 KB
testcase_08 AC 42 ms
24,060 KB
testcase_09 AC 36 ms
23,568 KB
testcase_10 AC 36 ms
24,084 KB
testcase_11 AC 37 ms
23,724 KB
testcase_12 AC 36 ms
24,372 KB
testcase_13 AC 36 ms
23,424 KB
testcase_14 AC 35 ms
24,084 KB
testcase_15 AC 34 ms
24,048 KB
testcase_16 AC 36 ms
23,712 KB
testcase_17 AC 36 ms
23,868 KB
testcase_18 AC 35 ms
24,300 KB
testcase_19 AC 34 ms
24,360 KB
testcase_20 AC 35 ms
24,312 KB
testcase_21 AC 45 ms
23,676 KB
testcase_22 AC 34 ms
24,324 KB
testcase_23 AC 35 ms
23,460 KB
testcase_24 AC 33 ms
23,580 KB
testcase_25 AC 36 ms
24,312 KB
testcase_26 AC 35 ms
24,084 KB
testcase_27 AC 34 ms
23,676 KB
testcase_28 AC 36 ms
23,460 KB
testcase_29 AC 35 ms
24,048 KB
testcase_30 AC 36 ms
24,300 KB
testcase_31 AC 34 ms
24,084 KB
testcase_32 AC 36 ms
23,664 KB
testcase_33 AC 36 ms
23,460 KB
testcase_34 AC 34 ms
24,360 KB
testcase_35 AC 36 ms
23,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

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

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

    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

    x = (l + r) / 2
0