結果

問題 No.1265 Balloon Survival
ユーザー gew1fw
提出日時 2025-06-12 16:01:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 707 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 82,840 KB
実行使用メモリ 75,264 KB
最終ジャッジ日時 2025-06-12 16:01:37
合計ジャッジ時間 3,171 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
balloons = [tuple(map(int, input().split())) for _ in range(n)]

count = 0

for i in range(1, n):
    x1, y1 = balloons[0]
    xi, yi = balloons[i]
    dx = xi - x1
    dy = yi - y1
    t_i = math.hypot(dx, dy) / 2  # distance / 2

    can_remove = False
    for j in range(1, n):
        if j == i:
            continue
        xj, yj = balloons[j]
        dx_ij = xj - xi
        dy_ij = yj - yi
        t_ij = math.hypot(dx_ij, dy_ij) / 2

        dx_j0 = xj - x1
        dy_j0 = yj - y1
        t_j = math.hypot(dx_j0, dy_j0) / 2

        if t_ij < t_i and t_j > t_ij:
            can_remove = True
            break

    if not can_remove:
        count += 1

print(count)
0