結果

問題 No.2602 Real Collider
ユーザー mkawa2mkawa2
提出日時 2024-01-12 22:04:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,347 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 96,724 KB
最終ジャッジ日時 2024-01-12 22:04:44
合計ジャッジ時間 12,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 41 ms
53,460 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 39 ms
53,460 KB
testcase_07 AC 40 ms
53,460 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 106 ms
81,884 KB
testcase_16 AC 125 ms
84,812 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 141 ms
87,448 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 130 ms
84,816 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 137 ms
85,640 KB
testcase_38 AC 140 ms
85,920 KB
testcase_39 WA -
testcase_40 AC 101 ms
80,656 KB
testcase_41 AC 145 ms
86,888 KB
testcase_42 AC 122 ms
84,272 KB
testcase_43 AC 123 ms
84,676 KB
testcase_44 AC 142 ms
87,032 KB
testcase_45 AC 116 ms
83,008 KB
testcase_46 AC 112 ms
81,952 KB
testcase_47 WA -
testcase_48 AC 117 ms
83,428 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 105 ms
81,472 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 121 ms
83,840 KB
testcase_56 WA -
testcase_57 AC 117 ms
83,152 KB
testcase_58 AC 87 ms
78,724 KB
testcase_59 AC 123 ms
84,284 KB
testcase_60 WA -
testcase_61 WA -
testcase_62 AC 129 ms
85,092 KB
testcase_63 AC 137 ms
86,336 KB
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 AC 125 ms
84,948 KB
testcase_75 WA -
testcase_76 WA -
testcase_77 AC 126 ms
84,676 KB
testcase_78 WA -
testcase_79 WA -
testcase_80 AC 140 ms
86,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(1000005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = -1-(-1 << 31)
# inf = -1-(-1 << 62)

# md = 10**9+7
md = 998244353

q=II()
xa,ya,xb,yb,xc,yc=LI()
xy=LLI(q)

xm=(xa+xb)/2
ym=(ya+yb)/2
xn=(xc+xb)/2
yn=(yc+yb)/2
vx=ya-yb
vy=xb-xa
wx=yb-yc
wy=xc-xb
mat=[[vx,-wx,xn-xm],
     [vy,-wy,yn-ym]]

if mat[0][0]==0:
    mat[0],mat[1]=mat[1],mat[0]
d=mat[0][0]
mat[0][0]=1
mat[0][1]/=d
mat[0][2]/=d

c=mat[1][0]
mat[1][0]=0
mat[1][1]-=mat[0][1]*c
mat[1][2]-=mat[0][2]*c

if mat[1][1]:
    s=mat[1][2]/mat[1][1]
    xo,yo=xn+wx*s,yn+wy*s
else:
    xo=(xa+xb+xc)/3
    yo=(ya+yb+yc)/3

r2=(xa-xo)**2+(ya-yo)**2

for x,y in xy:
    if (x-xo)**2+(y-yo)**2>r2:
        print("No")
    else:
        print("Yes")
0