結果

問題 No.2602 Real Collider
ユーザー 👑 p-adicp-adic
提出日時 2024-01-13 01:06:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 975 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,296 KB
最終ジャッジ日時 2024-01-13 01:06:35
合計ジャッジ時間 31,771 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 39 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 36 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 975 ms
76,296 KB
testcase_11 AC 392 ms
76,040 KB
testcase_12 AC 301 ms
76,124 KB
testcase_13 AC 165 ms
75,868 KB
testcase_14 AC 293 ms
76,124 KB
testcase_15 AC 309 ms
76,040 KB
testcase_16 AC 462 ms
76,040 KB
testcase_17 AC 475 ms
76,040 KB
testcase_18 AC 213 ms
75,868 KB
testcase_19 AC 274 ms
76,124 KB
testcase_20 AC 553 ms
76,168 KB
testcase_21 AC 207 ms
76,124 KB
testcase_22 AC 235 ms
76,124 KB
testcase_23 AC 186 ms
76,124 KB
testcase_24 AC 230 ms
76,124 KB
testcase_25 AC 233 ms
75,868 KB
testcase_26 AC 328 ms
76,040 KB
testcase_27 AC 257 ms
76,124 KB
testcase_28 AC 462 ms
76,040 KB
testcase_29 AC 230 ms
76,124 KB
testcase_30 AC 244 ms
76,124 KB
testcase_31 AC 466 ms
76,040 KB
testcase_32 AC 391 ms
76,040 KB
testcase_33 AC 446 ms
76,040 KB
testcase_34 AC 449 ms
76,040 KB
testcase_35 AC 304 ms
76,040 KB
testcase_36 AC 323 ms
76,040 KB
testcase_37 AC 471 ms
76,040 KB
testcase_38 AC 483 ms
76,040 KB
testcase_39 AC 474 ms
76,040 KB
testcase_40 AC 293 ms
76,040 KB
testcase_41 AC 525 ms
76,168 KB
testcase_42 AC 425 ms
76,040 KB
testcase_43 AC 434 ms
76,040 KB
testcase_44 AC 553 ms
76,168 KB
testcase_45 AC 354 ms
76,040 KB
testcase_46 AC 342 ms
76,040 KB
testcase_47 AC 477 ms
76,040 KB
testcase_48 AC 386 ms
76,040 KB
testcase_49 AC 363 ms
76,040 KB
testcase_50 AC 273 ms
76,040 KB
testcase_51 AC 303 ms
76,040 KB
testcase_52 AC 225 ms
76,040 KB
testcase_53 AC 454 ms
76,040 KB
testcase_54 AC 364 ms
76,040 KB
testcase_55 AC 421 ms
76,040 KB
testcase_56 AC 385 ms
76,040 KB
testcase_57 AC 369 ms
76,040 KB
testcase_58 AC 191 ms
76,040 KB
testcase_59 AC 428 ms
76,040 KB
testcase_60 AC 426 ms
76,040 KB
testcase_61 AC 329 ms
76,040 KB
testcase_62 AC 453 ms
76,040 KB
testcase_63 AC 505 ms
76,168 KB
testcase_64 AC 590 ms
76,168 KB
testcase_65 AC 365 ms
76,040 KB
testcase_66 AC 481 ms
76,040 KB
testcase_67 AC 271 ms
76,040 KB
testcase_68 AC 314 ms
76,040 KB
testcase_69 AC 249 ms
76,040 KB
testcase_70 AC 261 ms
76,040 KB
testcase_71 AC 314 ms
76,040 KB
testcase_72 AC 424 ms
76,040 KB
testcase_73 AC 370 ms
76,040 KB
testcase_74 AC 460 ms
76,040 KB
testcase_75 AC 464 ms
76,040 KB
testcase_76 AC 414 ms
76,040 KB
testcase_77 AC 431 ms
76,040 KB
testcase_78 AC 519 ms
76,168 KB
testcase_79 AC 482 ms
76,040 KB
testcase_80 AC 518 ms
76,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
J=lambda:map(int,I().split())
Q=int(I())
a,b,c,d,e,f=J()
X=[a,c,e,a,c]
Y=[b,d,f,b,d]
for i in R(3):
	py,qy=Y[i]+Y[i+1],2
	px,qx=X[i]+X[i+1],1
	r=((X[i]-X[i+1])**2+(Y[i]-Y[i+1])**2)*qx
	if(px-X[i+2]*qx*qy)**2+((py-Y[i+2]*qy)*qx)**2<=r:break
else:
	#https://qiita.com/tatesuke/items/59133758ec25146766c3
	L=[a*a+b*b,c*c+d*d,e*e+f*f]
	py,qy=(e-c)*L[0]-(e-a)*L[1]+(c-a)*L[2],2*((e-a)*(b-d)-(c-a)*(b-f))
	px=((2*(b-f)*py+L[2]*qy)if(c==a)else(2*(b-d)*py+L[1]*qy))-L[0]*qy
	qx=2*(e-a if c==a else c-a)
	r=(px-a*qx*qy)**2+((py-b*qy)*qx)**2
for q in R(Q):
	x,y=J()
	print("YNeos"[(px-x*qx*qy)**2+((py-y*qy)*qx)**2>r::2])
0