結果

問題 No.1265 Balloon Survival
ユーザー proriboneproribone
提出日時 2020-10-23 23:18:05
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 170,836 KB
最終ジャッジ日時 2023-09-28 18:32:17
合計ジャッジ時間 28,284 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,284 KB
testcase_01 AC 76 ms
71,300 KB
testcase_02 AC 75 ms
71,136 KB
testcase_03 AC 76 ms
71,348 KB
testcase_04 AC 76 ms
71,296 KB
testcase_05 AC 88 ms
75,088 KB
testcase_06 AC 78 ms
71,344 KB
testcase_07 WA -
testcase_08 AC 77 ms
71,260 KB
testcase_09 AC 77 ms
70,808 KB
testcase_10 AC 76 ms
71,180 KB
testcase_11 AC 77 ms
71,000 KB
testcase_12 AC 80 ms
74,980 KB
testcase_13 AC 77 ms
71,404 KB
testcase_14 AC 279 ms
87,896 KB
testcase_15 AC 204 ms
84,840 KB
testcase_16 AC 131 ms
80,628 KB
testcase_17 AC 1,040 ms
123,080 KB
testcase_18 AC 155 ms
82,480 KB
testcase_19 AC 136 ms
81,100 KB
testcase_20 AC 243 ms
87,588 KB
testcase_21 AC 496 ms
106,504 KB
testcase_22 AC 310 ms
90,648 KB
testcase_23 AC 327 ms
92,200 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 AC 83 ms
74,992 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

G=[]
for i in range(N):
    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))
        d.add(((dist+1)//2,min(i,j),max(i,j)))
d=sorted(d)

delete=set()

for t,i,j in d:
    if i in delete or j in delete:
        continue
    if i!=0 and j!=0:
        delete.add(i)
        delete.add(j)
    elif i==0:
        delete.add(j)
        res+=1
    elif j==0:
        delete.add(i)
        res+=1
print(res)
0