結果

問題 No.253 ロウソクの長さ
ユーザー maninimanini
提出日時 2021-02-12 15:33:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 794 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 87,676 KB
平均クエリ数 35.00
最終ジャッジ日時 2023-09-24 02:51:27
合計ジャッジ時間 5,228 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
87,364 KB
testcase_01 AC 86 ms
87,072 KB
testcase_02 AC 94 ms
87,016 KB
testcase_03 AC 89 ms
87,128 KB
testcase_04 AC 84 ms
87,372 KB
testcase_05 AC 85 ms
87,024 KB
testcase_06 AC 82 ms
87,176 KB
testcase_07 AC 82 ms
87,248 KB
testcase_08 AC 86 ms
87,508 KB
testcase_09 AC 82 ms
86,992 KB
testcase_10 AC 88 ms
87,356 KB
testcase_11 AC 85 ms
86,876 KB
testcase_12 AC 83 ms
87,404 KB
testcase_13 AC 83 ms
87,128 KB
testcase_14 AC 82 ms
87,516 KB
testcase_15 AC 88 ms
87,676 KB
testcase_16 AC 88 ms
87,252 KB
testcase_17 AC 90 ms
87,304 KB
testcase_18 AC 88 ms
87,104 KB
testcase_19 AC 84 ms
87,228 KB
testcase_20 AC 84 ms
87,140 KB
testcase_21 AC 83 ms
87,488 KB
testcase_22 AC 82 ms
87,112 KB
testcase_23 AC 84 ms
86,796 KB
testcase_24 AC 92 ms
87,056 KB
testcase_25 AC 83 ms
87,464 KB
testcase_26 AC 83 ms
87,184 KB
testcase_27 AC 83 ms
87,276 KB
testcase_28 AC 84 ms
87,016 KB
testcase_29 AC 84 ms
86,948 KB
testcase_30 AC 84 ms
86,956 KB
testcase_31 AC 84 ms
87,528 KB
testcase_32 AC 83 ms
86,888 KB
testcase_33 AC 84 ms
87,196 KB
testcase_34 AC 81 ms
87,120 KB
testcase_35 AC 83 ms
86,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:UTF-8
import sys

MOD = 10 ** 9 + 7
INF = float('inf')

# 二分探索
imin = 0
imax = 10 ** 9 + 1

print("? {}".format(99))
check = int(input())

if check == 0:
    print("! {}".format(99))

elif check == -1:
    time = 1
    while True:
        print("? {}".format(0))
        check = int(input())

        if check == 0:
            break

        time += 1

    print("! {}".format(time))

elif check == 1:
    time = 1
    while True:
        imid = imin + (imax - imin) // 2

        print("? {}".format(imid - time))
        check = int(input())

        # 2分探索する。
        if check == 0:
            res = imid
            break
        elif check == 1:
            imin = imid
        else:
            imax = imid

        time += 1

    print("! {}".format(res))
0