結果

問題 No.253 ロウソクの長さ
ユーザー kimiyukikimiyuki
提出日時 2016-09-27 21:44:08
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 24,452 KB
平均クエリ数 20.97
最終ジャッジ日時 2023-09-24 00:34:22
合計ジャッジ時間 3,810 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,848 KB
testcase_01 AC 40 ms
23,984 KB
testcase_02 AC 40 ms
23,800 KB
testcase_03 AC 39 ms
24,156 KB
testcase_04 AC 39 ms
23,724 KB
testcase_05 AC 39 ms
24,276 KB
testcase_06 AC 41 ms
24,252 KB
testcase_07 AC 42 ms
24,384 KB
testcase_08 AC 41 ms
23,828 KB
testcase_09 AC 39 ms
23,660 KB
testcase_10 AC 41 ms
24,080 KB
testcase_11 AC 40 ms
23,896 KB
testcase_12 AC 40 ms
23,796 KB
testcase_13 AC 41 ms
24,240 KB
testcase_14 AC 40 ms
23,860 KB
testcase_15 AC 40 ms
24,284 KB
testcase_16 AC 40 ms
23,772 KB
testcase_17 AC 41 ms
24,292 KB
testcase_18 AC 41 ms
24,084 KB
testcase_19 AC 40 ms
23,792 KB
testcase_20 AC 40 ms
23,828 KB
testcase_21 AC 39 ms
24,108 KB
testcase_22 AC 40 ms
23,872 KB
testcase_23 AC 41 ms
24,312 KB
testcase_24 AC 40 ms
24,068 KB
testcase_25 AC 40 ms
23,856 KB
testcase_26 AC 40 ms
23,620 KB
testcase_27 AC 40 ms
23,816 KB
testcase_28 AC 40 ms
24,264 KB
testcase_29 AC 41 ms
23,996 KB
testcase_30 AC 41 ms
24,452 KB
testcase_31 AC 41 ms
24,432 KB
testcase_32 AC 40 ms
24,336 KB
testcase_33 AC 41 ms
24,392 KB
testcase_34 AC 39 ms
23,780 KB
testcase_35 AC 40 ms
23,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
def ask(y):
    print('?', y)
    sys.stdout.flush()
    return int(input())
def ans(y):
    print('!', y)
    sys.exit()

m = 100
p = ask(m)
if p == 1:
    l = m
    r = 10**9 # (l, r]
elif p == -1:
    l = 10-1
    r = m-1
else:
    ans(m)
for i in range(1,100):
    m = (l+r+1) // 2
    p = ask(m-i)
    if p == 1:
        l = m
    elif p == -1:
        r = m
    else:
        ans(m)
0