結果

問題 No.2602 Real Collider
ユーザー maeshunmaeshun
提出日時 2024-01-13 13:55:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,330 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 76,808 KB
最終ジャッジ日時 2024-01-13 13:56:10
合計ジャッジ時間 33,814 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 36 ms
53,460 KB
testcase_05 AC 35 ms
53,460 KB
testcase_06 AC 35 ms
53,460 KB
testcase_07 AC 34 ms
53,460 KB
testcase_08 AC 35 ms
53,460 KB
testcase_09 AC 35 ms
53,460 KB
testcase_10 AC 933 ms
76,552 KB
testcase_11 AC 383 ms
76,296 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 331 ms
76,296 KB
testcase_16 AC 433 ms
76,296 KB
testcase_17 AC 499 ms
76,296 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 536 ms
76,424 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 306 ms
76,296 KB
testcase_27 WA -
testcase_28 AC 462 ms
76,296 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 436 ms
76,296 KB
testcase_32 AC 389 ms
76,296 KB
testcase_33 AC 436 ms
76,296 KB
testcase_34 AC 441 ms
76,296 KB
testcase_35 AC 302 ms
76,296 KB
testcase_36 AC 313 ms
76,296 KB
testcase_37 AC 467 ms
76,296 KB
testcase_38 AC 510 ms
76,296 KB
testcase_39 AC 470 ms
76,296 KB
testcase_40 AC 267 ms
76,296 KB
testcase_41 AC 541 ms
76,424 KB
testcase_42 AC 420 ms
76,296 KB
testcase_43 AC 426 ms
76,296 KB
testcase_44 AC 545 ms
76,424 KB
testcase_45 AC 366 ms
76,424 KB
testcase_46 AC 346 ms
76,296 KB
testcase_47 AC 489 ms
76,296 KB
testcase_48 AC 379 ms
76,296 KB
testcase_49 AC 341 ms
76,296 KB
testcase_50 AC 279 ms
76,296 KB
testcase_51 AC 319 ms
76,296 KB
testcase_52 AC 227 ms
76,296 KB
testcase_53 AC 441 ms
76,296 KB
testcase_54 AC 362 ms
76,296 KB
testcase_55 AC 392 ms
76,296 KB
testcase_56 AC 416 ms
76,296 KB
testcase_57 AC 371 ms
76,296 KB
testcase_58 AC 198 ms
76,552 KB
testcase_59 AC 426 ms
76,296 KB
testcase_60 AC 405 ms
76,296 KB
testcase_61 AC 355 ms
76,296 KB
testcase_62 AC 456 ms
76,296 KB
testcase_63 AC 496 ms
76,424 KB
testcase_64 AC 557 ms
76,424 KB
testcase_65 AC 353 ms
76,296 KB
testcase_66 AC 487 ms
76,296 KB
testcase_67 AC 270 ms
76,296 KB
testcase_68 AC 303 ms
76,424 KB
testcase_69 AC 242 ms
76,424 KB
testcase_70 AC 264 ms
76,296 KB
testcase_71 AC 346 ms
76,296 KB
testcase_72 AC 435 ms
76,296 KB
testcase_73 AC 379 ms
76,296 KB
testcase_74 AC 446 ms
76,296 KB
testcase_75 AC 498 ms
76,296 KB
testcase_76 AC 419 ms
76,296 KB
testcase_77 AC 434 ms
76,296 KB
testcase_78 AC 516 ms
76,424 KB
testcase_79 AC 490 ms
76,296 KB
testcase_80 AC 515 ms
76,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    q = int(input())
    x1, y1, x2, y2, x3, y3 = map(int, input().split())
    r = 0
    if (x2 - x1) * (y3 - y1) == (x3 - x1) * (y2 - y1):
        Mx = max(x1, max(x2, x3))
        mx = min(x1, min(x2, x3))
        My = max(y1, max(y2, y3))
        my = min(y1, min(y2, y3))
        r = (Mx - mx) ** 2 + (My - my) ** 2
        xg = (mx + Mx)
        yg = (my + My)
        for _ in range(q):
            x, y = map(int, input().split())
            x *= 2
            y *= 2
            R = (xg - x) ** 2 + (yg - y) ** 2
            
            if R <= r:
                print("Yes")
            else:
                print("No")
    else:
        det = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)
        m = [[y3 - y1, -y2 + y1], [-x3 + x1, x2 - x1]]
        f = [x2 ** 2 + y2 ** 2 - x1 ** 2 - y1 ** 2, x3 ** 2 + y3 ** 2 - x1 ** 2 - y1 ** 2]
        e = [m[0][0] * f[0] + m[0][1] * f[1],
             m[1][0] * f[0] + m[1][1] * f[1]]
        r = (e[0] - 2 * det * x1) ** 2 + (e[1] - 2 * det * y1) ** 2
        for _ in range(q):
            x, y = map(int, input().split())
            x *= 2 * det
            y *= 2 * det
            R = (e[0] - x) ** 2 + (e[1] - y) ** 2
            if R <= r:
                print("Yes")
            else:
                print("No")

if __name__ == "__main__":
    main()
0