結果

問題 No.513 宝探し2
ユーザー GrayCoder
提出日時 2017-09-03 10:49:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 616 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,480 KB
平均クエリ数 33.50
最終ジャッジ日時 2024-07-16 14:10:13
合計ジャッジ時間 1,649 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    xmin = 0
    xmax = 100000

    while True:
        x = xmin + (xmax - xmin) // 2
        print(x, 0)
        ret1 = int(input())
        print(x + 1, 0)
        ret2 = int(input())

        if ret1 < ret2:
            xmax = x
        else:
            xmin = x

        if xmax - xmin == 1:
            print(xmin, 0)
            ret1 = int(input())
            print(xmax, 0)
            ret2 = int(input())
            if ret1 < ret2:
                x = xmin
                y = ret1
            else:
                x = xmax
                y = ret2
            break

    print(x, y)

main()
0