結果
問題 |
No.1265 Balloon Survival
|
ユーザー |
![]() |
提出日時 | 2020-10-23 22:55:02 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 353 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 78,336 KB |
最終ジャッジ日時 | 2024-07-21 12:05:11 |
合計ジャッジ時間 | 5,703 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 3 WA * 29 |
ソースコード
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)