結果

問題 No.2602 Real Collider
ユーザー Moss_LocalMoss_Local
提出日時 2024-01-12 22:31:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,440 bytes
コンパイル時間 609 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 46,312 KB
最終ジャッジ日時 2024-01-12 22:32:45
合計ジャッジ時間 57,283 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 552 ms
46,312 KB
testcase_01 WA -
testcase_02 AC 525 ms
46,308 KB
testcase_03 AC 536 ms
46,308 KB
testcase_04 WA -
testcase_05 AC 519 ms
46,308 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 682 ms
46,308 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 615 ms
46,308 KB
testcase_16 AC 693 ms
46,308 KB
testcase_17 AC 682 ms
46,312 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 724 ms
46,292 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 624 ms
46,292 KB
testcase_27 WA -
testcase_28 AC 683 ms
46,308 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 675 ms
46,308 KB
testcase_32 AC 645 ms
46,308 KB
testcase_33 AC 706 ms
46,312 KB
testcase_34 AC 677 ms
46,308 KB
testcase_35 AC 613 ms
46,292 KB
testcase_36 AC 639 ms
46,308 KB
testcase_37 AC 684 ms
46,308 KB
testcase_38 AC 683 ms
46,312 KB
testcase_39 AC 705 ms
46,308 KB
testcase_40 AC 598 ms
46,312 KB
testcase_41 AC 733 ms
46,292 KB
testcase_42 AC 659 ms
46,308 KB
testcase_43 AC 655 ms
46,308 KB
testcase_44 AC 737 ms
46,308 KB
testcase_45 AC 635 ms
46,312 KB
testcase_46 AC 628 ms
46,308 KB
testcase_47 AC 710 ms
46,308 KB
testcase_48 AC 643 ms
46,292 KB
testcase_49 AC 625 ms
46,308 KB
testcase_50 AC 625 ms
46,292 KB
testcase_51 AC 599 ms
46,312 KB
testcase_52 AC 582 ms
46,308 KB
testcase_53 AC 697 ms
46,292 KB
testcase_54 AC 631 ms
46,308 KB
testcase_55 AC 650 ms
46,308 KB
testcase_56 AC 675 ms
46,308 KB
testcase_57 AC 638 ms
46,292 KB
testcase_58 AC 567 ms
46,308 KB
testcase_59 AC 693 ms
46,308 KB
testcase_60 AC 657 ms
46,308 KB
testcase_61 AC 624 ms
46,308 KB
testcase_62 AC 698 ms
46,292 KB
testcase_63 AC 703 ms
46,308 KB
testcase_64 AC 714 ms
46,292 KB
testcase_65 AC 649 ms
46,308 KB
testcase_66 AC 688 ms
46,292 KB
testcase_67 AC 592 ms
46,292 KB
testcase_68 AC 630 ms
46,308 KB
testcase_69 AC 582 ms
46,308 KB
testcase_70 AC 583 ms
46,308 KB
testcase_71 AC 642 ms
46,308 KB
testcase_72 AC 665 ms
46,308 KB
testcase_73 AC 630 ms
46,308 KB
testcase_74 AC 693 ms
46,308 KB
testcase_75 AC 672 ms
46,292 KB
testcase_76 AC 665 ms
46,308 KB
testcase_77 AC 686 ms
46,308 KB
testcase_78 AC 704 ms
46,292 KB
testcase_79 AC 715 ms
46,308 KB
testcase_80 AC 701 ms
46,308 KB
権限があれば一括ダウンロードができます

ソースコード

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:
        exit()
    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()
0