結果

問題 No.513 宝探し2
ユーザー nanaenanae
提出日時 2017-05-06 00:21:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 629 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 24,288 KB
平均クエリ数 61.42
最終ジャッジ日時 2023-09-23 13:52:38
合計ジャッジ時間 1,767 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,628 KB
testcase_01 AC 43 ms
24,048 KB
testcase_02 AC 42 ms
24,060 KB
testcase_03 AC 42 ms
24,288 KB
testcase_04 AC 43 ms
24,288 KB
testcase_05 AC 42 ms
24,012 KB
testcase_06 AC 42 ms
23,728 KB
testcase_07 AC 42 ms
23,352 KB
testcase_08 RE -
testcase_09 AC 42 ms
23,820 KB
testcase_10 AC 43 ms
23,720 KB
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

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())

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

        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())

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

    return

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