結果

問題 No.2602 Real Collider
ユーザー ShirotsumeShirotsume
提出日時 2024-01-12 23:56:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,667 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,072 KB
最終ジャッジ日時 2024-01-12 23:56:34
合計ジャッジ時間 11,933 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
56,264 KB
testcase_01 AC 43 ms
56,264 KB
testcase_02 AC 42 ms
56,264 KB
testcase_03 AC 43 ms
56,264 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 95 ms
77,064 KB
testcase_12 AC 101 ms
77,072 KB
testcase_13 AC 79 ms
76,924 KB
testcase_14 AC 105 ms
76,944 KB
testcase_15 AC 91 ms
77,064 KB
testcase_16 AC 99 ms
77,064 KB
testcase_17 AC 103 ms
77,064 KB
testcase_18 AC 87 ms
76,924 KB
testcase_19 AC 99 ms
76,944 KB
testcase_20 AC 108 ms
77,064 KB
testcase_21 AC 94 ms
76,944 KB
testcase_22 AC 98 ms
77,072 KB
testcase_23 AC 89 ms
77,072 KB
testcase_24 AC 97 ms
77,072 KB
testcase_25 AC 90 ms
76,924 KB
testcase_26 AC 92 ms
77,064 KB
testcase_27 AC 102 ms
77,072 KB
testcase_28 AC 102 ms
77,064 KB
testcase_29 AC 97 ms
76,944 KB
testcase_30 AC 100 ms
77,072 KB
testcase_31 AC 100 ms
77,064 KB
testcase_32 AC 97 ms
77,064 KB
testcase_33 AC 102 ms
77,064 KB
testcase_34 AC 99 ms
77,064 KB
testcase_35 AC 91 ms
77,064 KB
testcase_36 AC 89 ms
77,064 KB
testcase_37 AC 101 ms
77,064 KB
testcase_38 AC 102 ms
77,064 KB
testcase_39 AC 102 ms
77,064 KB
testcase_40 AC 87 ms
77,064 KB
testcase_41 AC 106 ms
77,064 KB
testcase_42 AC 98 ms
77,064 KB
testcase_43 AC 98 ms
77,064 KB
testcase_44 AC 105 ms
77,064 KB
testcase_45 AC 94 ms
77,064 KB
testcase_46 AC 93 ms
77,064 KB
testcase_47 AC 102 ms
77,064 KB
testcase_48 AC 97 ms
77,064 KB
testcase_49 AC 100 ms
77,064 KB
testcase_50 AC 92 ms
77,064 KB
testcase_51 AC 88 ms
77,064 KB
testcase_52 AC 84 ms
77,064 KB
testcase_53 AC 100 ms
77,064 KB
testcase_54 AC 94 ms
77,064 KB
testcase_55 AC 96 ms
77,064 KB
testcase_56 AC 96 ms
77,064 KB
testcase_57 AC 94 ms
77,064 KB
testcase_58 AC 81 ms
77,064 KB
testcase_59 AC 98 ms
77,064 KB
testcase_60 AC 96 ms
77,064 KB
testcase_61 AC 90 ms
77,064 KB
testcase_62 AC 100 ms
77,064 KB
testcase_63 AC 103 ms
77,064 KB
testcase_64 AC 108 ms
77,064 KB
testcase_65 AC 96 ms
77,064 KB
testcase_66 AC 102 ms
77,064 KB
testcase_67 AC 88 ms
77,064 KB
testcase_68 AC 90 ms
77,064 KB
testcase_69 AC 84 ms
77,064 KB
testcase_70 AC 87 ms
77,064 KB
testcase_71 AC 90 ms
77,064 KB
testcase_72 AC 99 ms
77,064 KB
testcase_73 AC 93 ms
77,064 KB
testcase_74 AC 100 ms
77,064 KB
testcase_75 AC 101 ms
77,064 KB
testcase_76 AC 97 ms
77,064 KB
testcase_77 AC 98 ms
77,064 KB
testcase_78 AC 105 ms
77,064 KB
testcase_79 AC 102 ms
77,064 KB
testcase_80 AC 105 ms
77,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353


n = 3
q = ii()
x1, y1, x2, y2, x3, y3 = mi()
xy = [[x1, y1], [x2, y2], [x3, y3]]


#三角形
ans = inf
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            a, b = xy[i]
            c, d = xy[j]
            e, f = xy[k]
            if a == c == e or b == d == f:
                continue
            py = ((e - a) * (a * a + b * b - c * c - d * d) - (c - a) * (a * a + b * b - e * e - f * f)) / (2 * (e - a) * (b - d) - 2 * (c - a) * (b - f) + 0.000000001)
            
            if c == a:
                px = (2 * (b - f) * py - a * a - b * b + e * e + f * f) / (2 * (e - a))
            else:
                px = (2 * (b - d) * py - a * a - b * b + c * c + d * d) / (2 * (c - a))
            r = 0
            for to in range(n):
                r = max(r, (px - xy[to][0]) ** 2 + (py - xy[to][1]) ** 2)
            if ans > r:
                X, Y = px, py
                ans = min(ans, r)

for i in range(n):
    for j in range(i + 1, n):
        a, b = xy[i]
        c, d = xy[j]
        px = (a + c) / 2
        py = (b + d) / 2
        r = 0
        for to in range(n):
            r = max(r, (px - xy[to][0]) ** 2 + (py - xy[to][1]) ** 2)
        if ans > r:
            X, Y = px, py
            ans = min(ans, r)
r = ans
for _ in range(q):
    x, y = mi()
    if (X - x) ** 2 + (Y - y) ** 2 <= r + 0.0001:
        print('Yes')
    else:
        print('No')
    
0