結果

問題 No.513 宝探し2
ユーザー hedwig100hedwig100
提出日時 2020-05-28 11:25:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 551 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 24,540 KB
平均クエリ数 55.58
最終ジャッジ日時 2023-09-24 03:35:37
合計ジャッジ時間 3,180 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 WA -
testcase_05 AC 31 ms
24,540 KB
testcase_06 WA -
testcase_07 AC 32 ms
24,012 KB
testcase_08 AC 36 ms
23,772 KB
testcase_09 RE -
testcase_10 WA -
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def ask(x,y):
    print(x,y,flush = True)
    d = int(input())
    if d == 0:
        exit()
    return d

Lx = -1
Rx = 100001
while Rx - Lx > 1:
    Mx = (Rx + Lx)//2
    d1 = ask(Mx,0)
    d2 = ask(Mx + 1,0)
    if d1 < d2:
        Rx = d1
    else:
        Lx = d1

Ly = -1
Ry = 100001
while Ry - Ly > 1:
    My = (Ry + Ly)//2
    d1 = ask(0,My)
    d2 = ask(0,My + 1)
    if d1 < d2:
        Ry = d1
    else:
        Ly = d1

ask(Rx,Ry)
ask(Lx,Ly)
ask(Rx,Ly)
ask(Lx,Ry)
0