結果

問題 No.2602 Real Collider
ユーザー 👑 kmjpkmjp
提出日時 2024-01-13 00:10:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 91,620 KB
最終ジャッジ日時 2024-01-13 00:12:04
合計ジャッジ時間 70,227 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
87,688 KB
testcase_01 WA -
testcase_02 AC 130 ms
87,688 KB
testcase_03 AC 177 ms
88,328 KB
testcase_04 AC 136 ms
87,688 KB
testcase_05 AC 134 ms
87,688 KB
testcase_06 AC 135 ms
87,688 KB
testcase_07 AC 137 ms
87,688 KB
testcase_08 AC 132 ms
87,688 KB
testcase_09 AC 133 ms
87,688 KB
testcase_10 AC 1,877 ms
91,368 KB
testcase_11 AC 897 ms
90,884 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 751 ms
90,120 KB
testcase_16 AC 1,016 ms
90,768 KB
testcase_17 AC 1,097 ms
90,468 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1,189 ms
91,204 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 713 ms
90,632 KB
testcase_27 WA -
testcase_28 AC 963 ms
90,888 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 1,022 ms
90,648 KB
testcase_32 AC 918 ms
90,120 KB
testcase_33 AC 1,014 ms
90,120 KB
testcase_34 AC 992 ms
90,676 KB
testcase_35 AC 730 ms
90,376 KB
testcase_36 AC 706 ms
91,272 KB
testcase_37 AC 1,081 ms
90,496 KB
testcase_38 AC 1,064 ms
90,712 KB
testcase_39 AC 1,091 ms
90,120 KB
testcase_40 AC 691 ms
90,248 KB
testcase_41 AC 1,175 ms
90,596 KB
testcase_42 AC 983 ms
90,324 KB
testcase_43 AC 993 ms
90,660 KB
testcase_44 AC 1,218 ms
90,812 KB
testcase_45 AC 858 ms
90,536 KB
testcase_46 AC 828 ms
90,248 KB
testcase_47 AC 1,101 ms
90,120 KB
testcase_48 AC 863 ms
90,120 KB
testcase_49 AC 809 ms
90,760 KB
testcase_50 AC 702 ms
90,120 KB
testcase_51 AC 720 ms
90,120 KB
testcase_52 AC 616 ms
90,120 KB
testcase_53 AC 1,019 ms
90,208 KB
testcase_54 AC 857 ms
90,120 KB
testcase_55 AC 945 ms
90,504 KB
testcase_56 AC 941 ms
90,640 KB
testcase_57 AC 901 ms
90,556 KB
testcase_58 AC 524 ms
90,504 KB
testcase_59 AC 1,025 ms
90,528 KB
testcase_60 AC 945 ms
90,992 KB
testcase_61 AC 772 ms
90,504 KB
testcase_62 AC 1,046 ms
90,596 KB
testcase_63 AC 1,141 ms
90,704 KB
testcase_64 AC 1,252 ms
90,448 KB
testcase_65 AC 776 ms
90,504 KB
testcase_66 AC 1,082 ms
90,340 KB
testcase_67 AC 661 ms
90,504 KB
testcase_68 AC 722 ms
90,376 KB
testcase_69 AC 584 ms
90,504 KB
testcase_70 AC 666 ms
90,504 KB
testcase_71 AC 767 ms
90,376 KB
testcase_72 AC 993 ms
90,200 KB
testcase_73 AC 857 ms
90,120 KB
testcase_74 AC 967 ms
90,396 KB
testcase_75 AC 1,076 ms
90,484 KB
testcase_76 AC 948 ms
90,120 KB
testcase_77 AC 978 ms
90,576 KB
testcase_78 AC 1,171 ms
90,324 KB
testcase_79 AC 1,043 ms
90,332 KB
testcase_80 AC 1,142 ms
90,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction
import sys
import math

Q=int(input())
X1,Y1,X2,Y2,X3,Y3=map(Fraction,input().strip().split(" "))
CX=-100000

for i in range(3) :
	if (Y2-Y1)*(Y2-Y1)+(X2-X1)*(X2-X1)+(Y3-Y1)*(Y3-Y1)+(X3-X1)*(X3-X1) <= (Y3-Y2)*(Y3-Y2)+(X3-X2)*(X3-X2):
		CX=(X2+X3)/2
		CY=(Y2+Y3)/2
		break
	X1,X2,X3=X2,X3,X1
	Y1,Y2,Y3=Y2,Y3,Y1

if CX == -100000:
	CX = ((X1*X1+Y1*Y1)*(Y2-Y3)+(X2*X2+Y2*Y2)*(Y3-Y1)+(X3*X3+Y3*Y3)*(Y1-Y2))/(2*((Y2-Y3)*(X1-X2)-(Y1-Y2)*(X2-X3)))
	CY = ((X1*X1+Y1*Y1)*(X2-X3)+(X2*X2+Y2*Y2)*(X3-X1)+(X3*X3+Y3*Y3)*(X1-X2))/(2*((X2-X3)*(Y1-Y2)-(X1-X2)*(Y2-Y3)))

for i in range(Q):
	X,Y=map(Fraction,input().strip().split(" "))
	
	if (X-CX)*(X-CX)+(Y-CY)*(Y-CY) <= (X1-CX)*(X1-CX)+(Y1-CY)*(Y1-CY):
		print("Yes")
	else:
		print("No")

0