結果

問題 No.2602 Real Collider
ユーザー 👑 timitimi
提出日時 2024-01-12 21:48:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,105 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,120 KB
最終ジャッジ日時 2024-01-12 21:49:00
合計ジャッジ時間 20,697 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,716 KB
testcase_01 AC 39 ms
53,716 KB
testcase_02 AC 36 ms
53,716 KB
testcase_03 AC 38 ms
53,716 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 268 ms
76,120 KB
testcase_13 AC 164 ms
76,116 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 209 ms
76,116 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 206 ms
76,120 KB
testcase_22 AC 234 ms
76,116 KB
testcase_23 AC 184 ms
76,116 KB
testcase_24 AC 226 ms
76,116 KB
testcase_25 AC 235 ms
76,120 KB
testcase_26 WA -
testcase_27 AC 277 ms
76,116 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 WA -
testcase_70 WA -
testcase_71 WA -
testcase_72 WA -
testcase_73 WA -
testcase_74 WA -
testcase_75 WA -
testcase_76 WA -
testcase_77 WA -
testcase_78 WA -
testcase_79 WA -
testcase_80 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

Q=int(input())
ax,ay,bx,by,cx,cy=map(int, input().split())
A=[]
#BC
x,y,r=(bx+cx)/2,(by+cy)/2,(((bx-cx)**2+(by-cy)**2)**.5)/2 
if (ax-x)**2+(ay-y)**2<=r**2:
  A.append((r,x,y))
  
#CA
x,y,r=(ax+cx)/2,(ay+cy)/2,(((ax-cx)**2+(ay-cy)**2)**.5)/2 
if (bx-x)**2+(by-y)**2<=r**2:
  A.append((r,x,y))
  
#AB
x,y,r=(ax+bx)/2,(ay+by)/2,(((ax-bx)**2+(ay-by)**2)**.5)/2 
if (cx-x)**2+(cy-y)**2<=r**2:
  A.append((r,x,y))

def c(x1, y1, x2, y2, x3, y3):
    """
    3点を通る円の中心と半径を取得
    """
    d = 2 * ((y1 - y3) * (x1 - x2) - (y1 - y2) * (x1 - x3))
    if d==0:
      return 0,0,-1
    x = ((y1 - y3) * (y1 ** 2 - y2 ** 2 + x1 ** 2 - x2 ** 2) - (y1 - y2) * (y1 ** 2 - y3 ** 2 + x1 ** 2 - x3 ** 2)) / d
    y = ((x1 - x3) * (x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2) - (x1 - x2) * (x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2)) / -d
    r=((x - x1) ** 2 + (y - y1) ** 2)
    return x,y,r

if len(A)==0:
  x,y,r=c(ax,ay,bx,by,cx,cy)
  A.append((r,x,y))
A=sorted(A)
r,x,y=A[0]
for i in range(Q):
  xx,yy=map(int, input().split())
  if (x-xx)**2+(y-yy)**2>r**2:
    print('No')
  else:
    print('Yes')
0