結果

問題 No.2602 Real Collider
ユーザー fuppy_kyoprofuppy_kyopro
提出日時 2024-01-12 21:43:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 960 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-01-12 21:44:10
合計ジャッジ時間 46,149 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 36 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 31 ms
10,752 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 559 ms
10,752 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 414 ms
10,752 KB
testcase_16 AC 634 ms
10,752 KB
testcase_17 AC 704 ms
10,752 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 858 ms
10,752 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 417 ms
10,752 KB
testcase_27 WA -
testcase_28 AC 675 ms
10,752 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 623 ms
10,752 KB
testcase_32 AC 541 ms
10,752 KB
testcase_33 AC 629 ms
10,752 KB
testcase_34 AC 643 ms
10,752 KB
testcase_35 AC 403 ms
10,752 KB
testcase_36 AC 432 ms
10,752 KB
testcase_37 AC 717 ms
10,752 KB
testcase_38 AC 753 ms
10,752 KB
testcase_39 AC 694 ms
10,752 KB
testcase_40 AC 346 ms
10,752 KB
testcase_41 AC 802 ms
10,752 KB
testcase_42 AC 622 ms
10,752 KB
testcase_43 AC 638 ms
10,752 KB
testcase_44 AC 819 ms
10,752 KB
testcase_45 AC 527 ms
10,752 KB
testcase_46 AC 469 ms
10,752 KB
testcase_47 AC 746 ms
10,752 KB
testcase_48 AC 557 ms
10,752 KB
testcase_49 AC 465 ms
10,752 KB
testcase_50 AC 385 ms
10,752 KB
testcase_51 AC 387 ms
10,752 KB
testcase_52 AC 284 ms
10,752 KB
testcase_53 AC 661 ms
10,752 KB
testcase_54 AC 501 ms
10,752 KB
testcase_55 AC 562 ms
10,752 KB
testcase_56 AC 566 ms
10,752 KB
testcase_57 AC 532 ms
10,752 KB
testcase_58 AC 218 ms
10,752 KB
testcase_59 AC 614 ms
10,752 KB
testcase_60 AC 566 ms
10,752 KB
testcase_61 AC 453 ms
10,752 KB
testcase_62 AC 649 ms
10,752 KB
testcase_63 AC 752 ms
10,752 KB
testcase_64 AC 864 ms
10,752 KB
testcase_65 AC 428 ms
10,752 KB
testcase_66 AC 705 ms
10,752 KB
testcase_67 AC 338 ms
10,752 KB
testcase_68 AC 391 ms
10,752 KB
testcase_69 AC 282 ms
10,752 KB
testcase_70 AC 336 ms
10,752 KB
testcase_71 AC 443 ms
10,752 KB
testcase_72 AC 616 ms
10,752 KB
testcase_73 AC 519 ms
10,752 KB
testcase_74 AC 648 ms
10,752 KB
testcase_75 AC 708 ms
10,752 KB
testcase_76 AC 629 ms
10,752 KB
testcase_77 AC 613 ms
10,752 KB
testcase_78 AC 766 ms
10,752 KB
testcase_79 AC 656 ms
10,752 KB
testcase_80 AC 770 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from decimal import Decimal, getcontext

EPS = Decimal(1e-7)

n = int(input())
points = list(map(Decimal, 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)

r2 = (px - a) **2 + (py - b) ** 2


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

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