結果

問題 No.3520 L1等距離点
コンテスト
ユーザー titia
提出日時 2026-05-01 21:44:21
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 351 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 547 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 35,596 KB
平均クエリ数 6.83
最終ジャッジ日時 2026-05-01 21:44:31
合計ジャッジ時間 9,036 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

T,x,y,z,w=list(map(int,input().split()))

dis=abs(x-z)+abs(y-w)

OK=0
NG=T

while NG>OK+1:
    mid=(OK+NG)//2

    print("?",mid,flush=True)

    retx,rety=list(map(int,input().split()))

    nowdis=abs(x-retx)+abs(y-rety)

    if nowdis*2<=dis:
        OK=mid
    else:
        NG=mid

print("!",OK,flush=True)
0