結果

問題 No.1265 Balloon Survival
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-23 22:43:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 85,680 KB
最終ジャッジ日時 2023-09-28 16:53:59
合計ジャッジ時間 6,909 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
71,528 KB
testcase_01 AC 80 ms
71,544 KB
testcase_02 AC 78 ms
71,188 KB
testcase_03 AC 79 ms
71,588 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 79 ms
71,300 KB
testcase_08 WA -
testcase_09 AC 77 ms
71,304 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 80 ms
71,476 KB
testcase_35 AC 79 ms
71,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
XY = []
for i in range(n):
    x, y = map(int, input().split())
    XY.append((x, y))

if n == 1:
    print(0)
    exit()

import math
INF = float('inf')
D = [[INF]*n for _ in range(n)]
for i in range(n):
    x1, y1=XY[i]
    for j in range(n):
        if i == j:
            continue
        x2,y2 = XY[j]
        d = math.hypot(x1-x2, y1-y2)/2
        D[i][j] = d
#print(D)
ans = 0
used = set()
T = []
for i in range(1, n):
    T.append((D[0][i], i))
T.sort()
for d, i in T:
    for j in range(1, n):
        if j in used:
            continue
        if D[i][j] <= d:
            break
    else:
        ans += 1
        used.add(i)
print(ans)
0