結果

問題 No.1265 Balloon Survival
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-23 22:19:35
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 91,404 KB
最終ジャッジ日時 2023-09-28 16:13:24
合計ジャッジ時間 5,884 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,416 KB
testcase_01 AC 72 ms
71,700 KB
testcase_02 AC 73 ms
71,552 KB
testcase_03 AC 76 ms
71,468 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 73 ms
71,404 KB
testcase_08 WA -
testcase_09 AC 75 ms
71,460 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 WA -
testcase_35 AC 77 ms
71,456 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 = 10*18
D = [[INF]*n for _ in range(n)]
for i in range(n-1):
    x1, y1=XY[i]
    for j in range(i+1, n):
        x2,y2 = XY[j]
        d = math.hypot(x1-x2, y1-y2)/2
        D[i][j] = d
        D[j][i] = d
#print(D)
ans = 0
used = set()
for i in range(1, n):
    p = D[i][0]
    for j in range(1, n):
        if j in used:
            continue
        if D[i][j] < p:
            break
    else:
        ans += 1
        used.add(i)
print(ans)
0