結果

問題 No.2602 Real Collider
ユーザー Moss_LocalMoss_Local
提出日時 2024-01-12 22:27:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,458 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 87,224 KB
最終ジャッジ日時 2024-01-12 22:28:43
合計ジャッジ時間 56,079 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 530 ms
46,456 KB
testcase_01 AC 525 ms
46,460 KB
testcase_02 AC 539 ms
46,448 KB
testcase_03 AC 522 ms
46,448 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 529 ms
46,448 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 651 ms
46,448 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 600 ms
46,456 KB
testcase_16 AC 670 ms
46,448 KB
testcase_17 AC 674 ms
46,456 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 699 ms
46,460 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 670 ms
46,448 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 624 ms
46,460 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 672 ms
46,456 KB
testcase_38 AC 687 ms
46,448 KB
testcase_39 AC 683 ms
46,448 KB
testcase_40 WA -
testcase_41 AC 692 ms
46,456 KB
testcase_42 AC 654 ms
46,456 KB
testcase_43 AC 661 ms
46,456 KB
testcase_44 AC 698 ms
46,456 KB
testcase_45 AC 624 ms
46,460 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 626 ms
46,460 KB
testcase_50 AC 610 ms
46,460 KB
testcase_51 WA -
testcase_52 AC 576 ms
46,460 KB
testcase_53 WA -
testcase_54 AC 637 ms
46,456 KB
testcase_55 AC 644 ms
46,460 KB
testcase_56 WA -
testcase_57 AC 634 ms
46,456 KB
testcase_58 WA -
testcase_59 AC 657 ms
46,448 KB
testcase_60 WA -
testcase_61 AC 611 ms
46,448 KB
testcase_62 AC 664 ms
46,460 KB
testcase_63 AC 676 ms
46,456 KB
testcase_64 AC 705 ms
46,460 KB
testcase_65 AC 606 ms
46,460 KB
testcase_66 AC 675 ms
46,460 KB
testcase_67 AC 590 ms
46,456 KB
testcase_68 AC 602 ms
46,456 KB
testcase_69 WA -
testcase_70 AC 589 ms
46,456 KB
testcase_71 WA -
testcase_72 WA -
testcase_73 AC 631 ms
46,456 KB
testcase_74 AC 655 ms
46,448 KB
testcase_75 AC 666 ms
46,456 KB
testcase_76 WA -
testcase_77 AC 653 ms
46,460 KB
testcase_78 AC 687 ms
46,456 KB
testcase_79 WA -
testcase_80 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    solve()
0