結果

問題 No.1265 Balloon Survival
ユーザー proriboneproribone
提出日時 2020-10-23 22:55:02
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 79,932 KB
最終ジャッジ日時 2023-09-28 17:25:48
合計ジャッジ時間 7,621 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
71,180 KB
testcase_01 AC 80 ms
71,476 KB
testcase_02 AC 84 ms
71,208 KB
testcase_03 AC 85 ms
71,296 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 84 ms
71,232 KB
testcase_08 WA -
testcase_09 AC 81 ms
71,340 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 91 ms
75,764 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil,sqrt
from heapq import *

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

d=set()
res=0
for i in range(1,N):
    que=[]
    heapify(que)
    for j in range(N):
        if i==j:
            continue
        xi,yi=point[i]
        xj,yj=point[j]
        dist=ceil(sqrt((xi-xj)**2+(yi-yj)**2))
        heappush(que,(dist,j))
    while(que[0][1] in d):
        heappop(que)
    if que[0][1]==0:
        d.add(i)
        res+=1
print(res)
0