結果

問題 No.2602 Real Collider
ユーザー pitPpitP
提出日時 2024-01-12 22:47:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,275 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2024-01-12 22:48:00
合計ジャッジ時間 22,650 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 39 ms
53,460 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 37 ms
53,460 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 258 ms
75,888 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 274 ms
76,144 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 348 ms
76,144 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 266 ms
76,144 KB
testcase_32 AC 242 ms
75,888 KB
testcase_33 AC 286 ms
76,144 KB
testcase_34 AC 276 ms
76,144 KB
testcase_35 AC 203 ms
76,144 KB
testcase_36 AC 199 ms
76,144 KB
testcase_37 AC 289 ms
76,016 KB
testcase_38 AC 311 ms
76,144 KB
testcase_39 AC 287 ms
76,144 KB
testcase_40 AC 181 ms
76,144 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 306 ms
75,888 KB
testcase_48 WA -
testcase_49 AC 215 ms
76,144 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 272 ms
75,888 KB
testcase_54 WA -
testcase_55 AC 278 ms
76,144 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 268 ms
76,144 KB
testcase_60 AC 276 ms
76,144 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 AC 209 ms
75,888 KB
testcase_66 AC 290 ms
76,144 KB
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 190 ms
76,144 KB
testcase_70 WA -
testcase_71 AC 206 ms
76,144 KB
testcase_72 AC 270 ms
76,144 KB
testcase_73 AC 234 ms
76,144 KB
testcase_74 AC 298 ms
76,144 KB
testcase_75 AC 288 ms
75,888 KB
testcase_76 WA -
testcase_77 WA -
testcase_78 AC 338 ms
76,144 KB
testcase_79 AC 281 ms
76,144 KB
testcase_80 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://qiita.com/tatesuke/items/59133758ec25146766c3
from math import hypot

Q = int(input())
a, b, c, d, e, f = map(float, input().split())


if abs((c - a) * (f - b) - (d - b) * (e - a)) < 1e-9:
    px_nume = max(a, c, e) + min(a, c, e)
    px_deno = 2
    px = px_nume / px_deno

    py_nume = max(b, d, f) + min(b, d, f)
    py_deno = 2
    py = py_nume / py_deno
    r2 = py_deno ** 2 * (px_nume - a * px_deno) ** 2 + px_deno ** 2 * (py_nume - b * py_deno) ** 2
else:
    aa = a * a
    bb = b * b
    cc = c * c
    dd = d * d
    ee = e * e
    ff = f * f

    py_nume = (e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)
    py_deno = 2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)
    py = py_nume / py_deno

    if c == a:
        px_nume = 2 * (b - f) * py - aa - bb + ee + ff
        px_deno = 2 * (e - a)
    else:
        px_nume = 2 * (b - d) * py - aa - bb + cc + dd
        px_deno = 2 * (c - a)
    px = px_nume / px_deno

    r2 = py_deno ** 2 * (px_nume - a * px_deno) ** 2 + px_deno ** 2 * (py_nume - b * py_deno) ** 2

for _ in range(Q):
    x, y = map(float, input().split())
    R2 = py_deno ** 2 * (px_nume - x * px_deno) ** 2 + px_deno ** 2 * (py_nume - y * py_deno) ** 2

    if R2 > r2:
        print("No")
    else:
        print("Yes")
0