結果

問題 No.513 宝探し2
ユーザー nanaenanae
提出日時 2017-05-06 00:22:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 732 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 24,276 KB
平均クエリ数 61.25
最終ジャッジ日時 2023-09-24 01:09:35
合計ジャッジ時間 1,494 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,332 KB
testcase_01 AC 39 ms
24,264 KB
testcase_02 AC 37 ms
24,276 KB
testcase_03 AC 38 ms
23,664 KB
testcase_04 AC 39 ms
23,328 KB
testcase_05 AC 39 ms
23,436 KB
testcase_06 AC 38 ms
23,672 KB
testcase_07 AC 42 ms
23,740 KB
testcase_08 AC 38 ms
23,652 KB
testcase_09 AC 40 ms
23,444 KB
testcase_10 AC 40 ms
23,736 KB
testcase_11 AC 39 ms
23,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

lim = 10**5

def solve():
    btm = 0
    top = lim

    while btm != top:
        d = (top - btm) // 3

        print(0, btm + d, flush=True)
        a1 = int(input())

        if a1 == 0:
            return

        print(0, top - d, flush=True)
        a2 = int(input())

        if a2 == 0:
            return

        if d == 0:
            if a1 < a2:
                top -= 1
            else:
                btm += 1
        else:
            if a1 < a2:
                top = top - d
            else:
                btm = btm + d

    print(0, btm, flush=True)
    a = int(input())

    if a == 0: return

    print(a, btm, flush=True)
    a = int(input())

    return

if __name__ == '__main__':
    solve()
0