結果

問題 No.2602 Real Collider
ユーザー pitPpitP
提出日時 2024-01-12 22:52:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,464 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 76,248 KB
最終ジャッジ日時 2024-01-12 22:53:08
合計ジャッジ時間 34,215 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,332 KB
testcase_01 AC 34 ms
53,332 KB
testcase_02 AC 34 ms
53,332 KB
testcase_03 AC 37 ms
55,456 KB
testcase_04 AC 34 ms
53,332 KB
testcase_05 AC 37 ms
53,332 KB
testcase_06 AC 34 ms
53,332 KB
testcase_07 AC 35 ms
53,332 KB
testcase_08 AC 33 ms
53,332 KB
testcase_09 AC 34 ms
53,332 KB
testcase_10 AC 905 ms
76,248 KB
testcase_11 AC 395 ms
75,864 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 316 ms
75,864 KB
testcase_16 AC 443 ms
75,992 KB
testcase_17 AC 494 ms
75,992 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 583 ms
75,992 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 308 ms
75,864 KB
testcase_27 WA -
testcase_28 AC 479 ms
75,992 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 436 ms
75,992 KB
testcase_32 AC 401 ms
75,992 KB
testcase_33 AC 430 ms
75,992 KB
testcase_34 AC 438 ms
75,992 KB
testcase_35 AC 298 ms
75,864 KB
testcase_36 AC 312 ms
75,864 KB
testcase_37 AC 474 ms
75,992 KB
testcase_38 AC 492 ms
75,992 KB
testcase_39 AC 513 ms
75,992 KB
testcase_40 AC 277 ms
75,864 KB
testcase_41 AC 538 ms
75,992 KB
testcase_42 AC 422 ms
75,992 KB
testcase_43 AC 430 ms
75,992 KB
testcase_44 AC 556 ms
75,992 KB
testcase_45 AC 371 ms
75,992 KB
testcase_46 AC 351 ms
75,864 KB
testcase_47 AC 518 ms
75,992 KB
testcase_48 AC 388 ms
75,864 KB
testcase_49 AC 342 ms
75,864 KB
testcase_50 AC 305 ms
75,864 KB
testcase_51 AC 293 ms
75,864 KB
testcase_52 AC 223 ms
75,864 KB
testcase_53 AC 442 ms
75,992 KB
testcase_54 AC 363 ms
75,864 KB
testcase_55 AC 391 ms
75,992 KB
testcase_56 AC 385 ms
75,864 KB
testcase_57 AC 367 ms
75,864 KB
testcase_58 AC 189 ms
75,868 KB
testcase_59 AC 447 ms
75,992 KB
testcase_60 AC 404 ms
75,992 KB
testcase_61 AC 326 ms
75,864 KB
testcase_62 AC 442 ms
75,992 KB
testcase_63 AC 510 ms
75,992 KB
testcase_64 AC 561 ms
75,992 KB
testcase_65 AC 315 ms
75,864 KB
testcase_66 AC 468 ms
75,992 KB
testcase_67 AC 262 ms
75,864 KB
testcase_68 AC 331 ms
75,864 KB
testcase_69 AC 239 ms
75,864 KB
testcase_70 AC 264 ms
75,864 KB
testcase_71 AC 308 ms
75,864 KB
testcase_72 AC 421 ms
75,992 KB
testcase_73 AC 381 ms
75,864 KB
testcase_74 AC 486 ms
75,992 KB
testcase_75 AC 484 ms
75,992 KB
testcase_76 AC 427 ms
75,992 KB
testcase_77 AC 446 ms
75,992 KB
testcase_78 AC 521 ms
75,992 KB
testcase_79 AC 456 ms
75,992 KB
testcase_80 AC 529 ms
75,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://qiita.com/tatesuke/items/59133758ec25146766c3
Q = int(input())
a, b, c, d, e, f = map(int, input().split())


if (c - a) * (f - b) - (d - b) * (e - a) == 0:
    px_nume = max(a, c, e) + min(a, c, e)
    px_deno = 2

    py_nume = max(b, d, f) + min(b, d, f)
    py_deno = 2
    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(int, 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")
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)

    if c == a:
        px_nume = 2 * (b - f) * py_nume - (aa + bb - ee - ff) * py_deno
        px_deno = 2 * (e - a) * py_deno
    else:
        px_nume = 2 * (b - d) * py_nume - (aa + bb - cc - dd) * py_deno
        px_deno = 2 * (c - a) * py_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(int, 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