結果

問題 No.2602 Real Collider
ユーザー NP
提出日時 2024-01-19 18:29:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 97,208 KB
最終ジャッジ日時 2024-09-28 03:25:53
合計ジャッジ時間 14,400 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 7 WA * 71
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)

def solve():
    Q = int(input())
    XA, YA, XB, YB, XC, YC = map(int, input().split())
    luggage = [list(map(int, input().split())) for _ in range(Q)]
    x = (XA + XB + XC) / 3
    y = (YA + YB + YC) / 3
    r = max(distance(x, y, XA, YA), distance(x, y, XB, YB), distance(x, y, XC, YC))

    for xi, yi in luggage:
        if distance(x, y, xi, yi) <= r:
            print("Yes")
        else:
            print("No")

solve()
0