結果

問題 No.2602 Real Collider
ユーザー fuppy_kyoprofuppy_kyopro
提出日時 2024-01-12 21:40:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 907 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2024-01-12 21:41:19
合計ジャッジ時間 38,125 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,112 KB
testcase_01 AC 29 ms
10,112 KB
testcase_02 AC 29 ms
10,112 KB
testcase_03 AC 29 ms
10,112 KB
testcase_04 WA -
testcase_05 AC 29 ms
10,112 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 450 ms
10,240 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 342 ms
10,240 KB
testcase_16 AC 519 ms
10,240 KB
testcase_17 AC 595 ms
10,240 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 678 ms
10,240 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 347 ms
10,240 KB
testcase_27 WA -
testcase_28 AC 556 ms
10,240 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 516 ms
10,240 KB
testcase_32 AC 446 ms
10,240 KB
testcase_33 AC 550 ms
10,240 KB
testcase_34 AC 527 ms
10,240 KB
testcase_35 AC 337 ms
10,240 KB
testcase_36 AC 362 ms
10,240 KB
testcase_37 AC 593 ms
10,240 KB
testcase_38 AC 581 ms
10,240 KB
testcase_39 AC 564 ms
10,240 KB
testcase_40 AC 285 ms
10,240 KB
testcase_41 AC 675 ms
10,240 KB
testcase_42 AC 497 ms
10,240 KB
testcase_43 AC 510 ms
10,240 KB
testcase_44 AC 675 ms
10,240 KB
testcase_45 AC 414 ms
10,240 KB
testcase_46 AC 388 ms
10,240 KB
testcase_47 AC 575 ms
10,240 KB
testcase_48 AC 458 ms
10,240 KB
testcase_49 AC 386 ms
10,240 KB
testcase_50 AC 303 ms
10,240 KB
testcase_51 AC 321 ms
10,240 KB
testcase_52 AC 230 ms
10,240 KB
testcase_53 AC 542 ms
10,240 KB
testcase_54 AC 413 ms
10,240 KB
testcase_55 AC 469 ms
10,240 KB
testcase_56 AC 476 ms
10,240 KB
testcase_57 AC 429 ms
10,240 KB
testcase_58 AC 182 ms
10,240 KB
testcase_59 AC 525 ms
10,240 KB
testcase_60 AC 459 ms
10,240 KB
testcase_61 AC 361 ms
10,240 KB
testcase_62 AC 554 ms
10,240 KB
testcase_63 AC 604 ms
10,240 KB
testcase_64 AC 697 ms
10,240 KB
testcase_65 AC 370 ms
10,240 KB
testcase_66 AC 574 ms
10,240 KB
testcase_67 AC 284 ms
10,240 KB
testcase_68 AC 321 ms
10,240 KB
testcase_69 AC 233 ms
10,240 KB
testcase_70 AC 274 ms
10,240 KB
testcase_71 AC 374 ms
10,240 KB
testcase_72 AC 510 ms
10,240 KB
testcase_73 AC 430 ms
10,240 KB
testcase_74 AC 519 ms
10,240 KB
testcase_75 AC 593 ms
10,240 KB
testcase_76 AC 488 ms
10,240 KB
testcase_77 AC 510 ms
10,240 KB
testcase_78 AC 658 ms
10,240 KB
testcase_79 AC 546 ms
10,240 KB
testcase_80 AC 627 ms
10,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

EPS = 1e-5

n = int(input())
points = list(map(float, input().split()))
a = points[0]
b = points[1]
c = points[2]
d = points[3]
e = points[4]
f = points[5]

aa = a * a
bb = b * b
cc = c * c
dd = d * d
ee = e * e
ff = f * f

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

    px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \
        if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))
except ZeroDivisionError:
    mx = min([a, c, e])
    MX = max([a, c, e])
    my = min([b, d, f])
    MY = max([b, d, f])
    px = (mx + MX) / 2
    py = (my + MY) / 2

# print(px, py)

r = math.hypot(px - a, py - b)


for i in range(n):
    x, y = list(map(float, input().split()))

    if (x - px) * (x - px) + (y - py) * (y - py) - r * r < EPS:
        print("Yes")
    else:
        print("No")
0