結果

問題 No.253 ロウソクの長さ
ユーザー eitahoeitaho
提出日時 2015-08-20 22:56:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 24,444 KB
平均クエリ数 35.33
最終ジャッジ日時 2023-09-23 05:42:48
合計ジャッジ時間 8,062 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 WA -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 RE -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 RE -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

print("? 99")
S = input()
count = 0

if S == "0":
    print(100)
elif S == "-1":
    while 1:
        print("? 0")
        S = input()
        count += 1
        if S == "0":
            print(count)
else:
    L = 99
    R = int(1e9) + 1
    while 1:
        mid = (L + R) // 2
        print("?", mid - 1 - count)
        S = input()
        if S == "0":
            print(mid)
            break
        elif S == "-1":
            R = mid
        else:
            L = mid
        count += 1
0