結果

問題 No.2602 Real Collider
ユーザー anonymouslyanonymously
提出日時 2024-01-12 23:23:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 741 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2024-01-12 23:24:40
合計ジャッジ時間 42,392 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,112 KB
testcase_01 AC 30 ms
10,112 KB
testcase_02 AC 29 ms
10,112 KB
testcase_03 AC 30 ms
10,112 KB
testcase_04 AC 29 ms
10,112 KB
testcase_05 AC 29 ms
10,112 KB
testcase_06 AC 29 ms
10,112 KB
testcase_07 AC 30 ms
10,112 KB
testcase_08 AC 30 ms
10,112 KB
testcase_09 AC 29 ms
10,112 KB
testcase_10 AC 1,343 ms
10,112 KB
testcase_11 AC 498 ms
10,112 KB
testcase_12 AC 633 ms
10,112 KB
testcase_13 WA -
testcase_14 AC 674 ms
10,112 KB
testcase_15 AC 409 ms
10,112 KB
testcase_16 AC 576 ms
10,112 KB
testcase_17 AC 655 ms
10,112 KB
testcase_18 WA -
testcase_19 AC 539 ms
10,112 KB
testcase_20 AC 770 ms
10,112 KB
testcase_21 AC 430 ms
10,112 KB
testcase_22 AC 551 ms
10,112 KB
testcase_23 AC 353 ms
10,112 KB
testcase_24 AC 519 ms
10,112 KB
testcase_25 WA -
testcase_26 AC 380 ms
10,112 KB
testcase_27 AC 611 ms
10,112 KB
testcase_28 AC 616 ms
10,112 KB
testcase_29 AC 536 ms
10,112 KB
testcase_30 AC 545 ms
10,112 KB
testcase_31 AC 608 ms
10,112 KB
testcase_32 AC 495 ms
10,112 KB
testcase_33 AC 588 ms
10,112 KB
testcase_34 AC 582 ms
10,112 KB
testcase_35 AC 369 ms
10,112 KB
testcase_36 AC 391 ms
10,112 KB
testcase_37 AC 621 ms
10,112 KB
testcase_38 AC 669 ms
10,112 KB
testcase_39 AC 619 ms
10,112 KB
testcase_40 AC 311 ms
10,112 KB
testcase_41 AC 726 ms
10,112 KB
testcase_42 AC 545 ms
10,112 KB
testcase_43 AC 587 ms
10,112 KB
testcase_44 AC 722 ms
10,112 KB
testcase_45 AC 451 ms
10,112 KB
testcase_46 AC 424 ms
10,112 KB
testcase_47 AC 665 ms
10,112 KB
testcase_48 AC 490 ms
10,112 KB
testcase_49 AC 426 ms
10,112 KB
testcase_50 AC 335 ms
10,112 KB
testcase_51 AC 347 ms
10,112 KB
testcase_52 AC 248 ms
10,112 KB
testcase_53 AC 604 ms
10,112 KB
testcase_54 AC 456 ms
10,112 KB
testcase_55 AC 538 ms
10,112 KB
testcase_56 AC 500 ms
10,112 KB
testcase_57 AC 468 ms
10,112 KB
testcase_58 AC 196 ms
10,112 KB
testcase_59 AC 564 ms
10,112 KB
testcase_60 AC 511 ms
10,112 KB
testcase_61 AC 424 ms
10,112 KB
testcase_62 AC 589 ms
10,112 KB
testcase_63 AC 695 ms
10,112 KB
testcase_64 AC 763 ms
10,112 KB
testcase_65 AC 416 ms
10,112 KB
testcase_66 AC 631 ms
10,112 KB
testcase_67 AC 306 ms
10,112 KB
testcase_68 AC 352 ms
10,112 KB
testcase_69 AC 257 ms
10,112 KB
testcase_70 AC 303 ms
10,112 KB
testcase_71 AC 411 ms
10,112 KB
testcase_72 AC 561 ms
10,112 KB
testcase_73 AC 469 ms
10,112 KB
testcase_74 AC 586 ms
10,112 KB
testcase_75 AC 620 ms
10,112 KB
testcase_76 AC 567 ms
10,112 KB
testcase_77 AC 561 ms
10,112 KB
testcase_78 AC 717 ms
10,112 KB
testcase_79 AC 595 ms
10,112 KB
testcase_80 AC 714 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q=int(input())
Xa,Ya,Xb,Yb,Xc,Yc=map(int,input().split())
#各頂点の「内積」
inA=(Xb-Xa)*(Xc-Xa)+(Yb-Ya)*(Yc-Ya)
inB=(Xc-Xb)*(Xa-Xb)+(Yc-Yb)*(Ya-Yb)
inC=(Xa-Xc)*(Xb-Xc)+(Ya-Yc)*(Yb-Yc)

#中心
X0=None
Y0=None
det=1
if inA<0:
    X0=(Xb+Xc)/2
    Y0=(Yb+Yc)/2
elif inB<0:
    X0=(Xc+Xa)/2
    Y0=(Yc+Ya)/2
elif inC<0:
    X0=(Xa+Xb)/2
    Y0=(Ya+Yb)/2
else:
    #(X0-Xa)**2+(Y0-Ya)**2==(X0-Xb)**2+(Y0-Yb)**2==(X0-Xc)**2+(Y0-Yc)**2
    #-2*Xa*X0+Xa**2-2*Ya*Y0+Ya**2==-2*Xb*X0+Xb**2-2*Yb*Y0+Yb**2==-2*Xc*X0+Xc**2-2*Yc*Y0+Yc**2
    #2*(Xb-Xa)*X0+2*(Yb-Ya)*Y0==Xb**2-Xa**2+Yb**2-Ya**2
    #2*(Xc-Xa)*X0+2*(Yc-Ya)*Y0==Xc**2-Xa**2+Yc**2-Ya**2
    det=4*((Xb-Xa)*(Yc-Ya)-(Yb-Ya)*(Xc-Xa))
    #X0=(2*(Yc-Ya)(Xb**2-Xa**2+Yb**2-Ya**2)-2*(Yb-Ya)(Xc**2-Xa**2+Yc**2-Ya**2))/det
    X0=(2*(Yc-Ya)*(Xb**2-Xa**2+Yb**2-Ya**2)-2*(Yb-Ya)*(Xc**2-Xa**2+Yc**2-Ya**2))
    Y0=(-2*(Xc-Xa)*(Xb**2-Xa**2+Yb**2-Ya**2)+2*(Xb-Xa)*(Xc**2-Xa**2+Yc**2-Ya**2))

for i in range(Q):
    x,y=map(int,input().split())
    if (det*x-X0)**2+(det*y-Y0)**2>(det*Xa-X0)**2+(det*Ya-Y0)**2:
        print("No")
    else:
        print("Yes")
0