結果

問題 No.2602 Real Collider
ユーザー Ekiben542Ekiben542
提出日時 2024-01-19 18:36:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,143 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 96,948 KB
最終ジャッジ日時 2024-01-19 18:37:14
合計ジャッジ時間 13,813 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,716 KB
testcase_01 AC 37 ms
53,716 KB
testcase_02 AC 34 ms
53,716 KB
testcase_03 AC 36 ms
53,716 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 34 ms
53,716 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 140 ms
83,920 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 118 ms
81,980 KB
testcase_16 AC 148 ms
85,036 KB
testcase_17 AC 140 ms
86,128 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 157 ms
87,800 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 136 ms
85,728 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 141 ms
83,788 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 146 ms
85,864 KB
testcase_38 AC 142 ms
86,400 KB
testcase_39 AC 140 ms
85,864 KB
testcase_40 WA -
testcase_41 AC 146 ms
87,112 KB
testcase_42 AC 126 ms
84,624 KB
testcase_43 AC 130 ms
84,900 KB
testcase_44 AC 166 ms
87,256 KB
testcase_45 AC 114 ms
82,720 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 116 ms
82,548 KB
testcase_50 AC 107 ms
80,776 KB
testcase_51 WA -
testcase_52 AC 99 ms
79,908 KB
testcase_53 WA -
testcase_54 AC 122 ms
83,232 KB
testcase_55 AC 127 ms
84,064 KB
testcase_56 WA -
testcase_57 AC 126 ms
83,504 KB
testcase_58 WA -
testcase_59 AC 121 ms
84,636 KB
testcase_60 WA -
testcase_61 AC 114 ms
82,392 KB
testcase_62 AC 130 ms
85,444 KB
testcase_63 AC 145 ms
86,560 KB
testcase_64 AC 187 ms
88,344 KB
testcase_65 AC 117 ms
82,132 KB
testcase_66 AC 140 ms
86,128 KB
testcase_67 AC 105 ms
80,744 KB
testcase_68 AC 110 ms
81,572 KB
testcase_69 WA -
testcase_70 AC 100 ms
80,744 KB
testcase_71 WA -
testcase_72 WA -
testcase_73 AC 137 ms
83,504 KB
testcase_74 AC 132 ms
85,172 KB
testcase_75 AC 135 ms
85,864 KB
testcase_76 WA -
testcase_77 AC 125 ms
84,900 KB
testcase_78 AC 145 ms
86,976 KB
testcase_79 WA -
testcase_80 WA -
権限があれば一括ダウンロードができます

ソースコード

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)]
    D = 2 * (XA * (YB - YC) + XB * (YC - YA) + XC * (YA - YB))

    if D != 0:
        UX = ((XA * XA + YA * YA) * (YB - YC) + (XB * XB + YB * YB) * (YC - YA) + (XC * XC + YC * YC) * (YA - YB)) / D
        UY = ((XA * XA + YA * YA) * (XC - XB) + (XB * XB + YB * YB) * (XA - XC) + (XC * XC + YC * YC) * (XB - XA)) / D
        r = distance(UX, UY, XA, YA)
    else:
        dAB = distance(XA, YA, XB, YB)
        dBC = distance(XB, YB, XC, YC)
        dCA = distance(XC, YC, XA, YA)
        if dAB >= max(dBC, dCA):
            UX, UY, r = (XA + XB) / 2, (YA + YB) / 2, dAB / 2
        elif dBC >= max(dAB, dCA):
            UX, UY, r = (XB + XC) / 2, (YB + YC) / 2, dBC / 2
        else:
            UX, UY, r = (XC + XA) / 2, (YC + YA) / 2, dCA / 2
    for xi, yi in luggage:
        if distance(UX, UY, xi, yi) <= r:
            print("Yes")
        else:
            print("No")

solve()
0