結果
| 問題 |
No.2602 Real Collider
|
| コンテスト | |
| ユーザー |
Moss_Local
|
| 提出日時 | 2024-01-12 22:28:09 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,471 bytes |
| コンパイル時間 | 265 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 47,696 KB |
| 最終ジャッジ日時 | 2024-09-27 23:02:34 |
| 合計ジャッジ時間 | 59,826 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 59 WA * 19 |
ソースコード
from itertools import combinations
from cgitb import reset
from collections import defaultdict
from functools import lru_cache
from sys import flags, stdin
import math
import re
import queue
from tokenize import String
import typing
import itertools
import bisect
import statistics
import numpy as np
# from numpy.core.function_base import _needs_add_docstring
# from numpy.core.numeric import outer
input = stdin.readline
MOD = 1000000007
INF = 122337203685477580
def get_circle_center_and_radius(x1, y1, x2, y2, x3, y3):
"""
3点を通る円の中心と半径を取得
"""
d = 2 * ((y1 - y3) * (x1 - x2) - (y1 - y2) * (x1 - x3))
# print(d)
if d == 0.0:
return (0, 0), math.sqrt(x1**2+y1**2)
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 = math.sqrt((x - x1) ** 2 + (y - y1) ** 2)
return (x, y), r
def solve():
n = int(input().rstrip())
(x1, y1, x2, y2, x3, y3) = map(int, input().split())
(x, y), r = get_circle_center_and_radius(x1, y1, x2, y2, x3, y3)
for i in range(0, n):
x4, y4 = map(int, input().split())
if math.sqrt((x4 - x) ** 2 + (y4 - y) ** 2) <= r+0.0000000001:
print("Yes")
else:
print("No")
if __name__ == '__main__':
solve()
Moss_Local