結果

問題 No.2628 Shrinkage
ユーザー NP
提出日時 2024-02-16 21:41:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 55,164 KB
最終ジャッジ日時 2024-09-28 19:55:33
合計ジャッジ時間 2,047 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

def can_match():
    T = int(input())
    results = []
    for _ in range(T):
        x1, y1, x2, y2, X1, Y1, X2, Y2 = map(int, input().split())
        dist1 = ((x1-X1)**2 + (y1-Y1)**2)**0.5
        dist2 = ((x2-X2)**2 + (y2-Y2)**2)**0.5
        if abs(dist1 - dist2) < 1e-9 and (x1-x2)*(X1-X2) + (y1-y2)*(Y1-Y2) >= 0:
            results.append('Yes')
        else:
            results.append('No')
    for result in results:
        print(result)

can_match()


0