結果

問題 No.1265 Balloon Survival
ユーザー taiga000629taiga000629
提出日時 2020-10-24 01:17:23
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 511 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 145,416 KB
最終ジャッジ日時 2023-09-28 19:56:47
合計ジャッジ時間 8,975 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,632 KB
testcase_01 AC 76 ms
71,328 KB
testcase_02 AC 80 ms
71,240 KB
testcase_03 AC 78 ms
71,404 KB
testcase_04 AC 79 ms
71,224 KB
testcase_05 AC 76 ms
71,336 KB
testcase_06 AC 77 ms
71,548 KB
testcase_07 AC 77 ms
71,252 KB
testcase_08 AC 77 ms
71,316 KB
testcase_09 AC 77 ms
71,540 KB
testcase_10 AC 78 ms
71,220 KB
testcase_11 AC 77 ms
71,404 KB
testcase_12 AC 78 ms
71,224 KB
testcase_13 AC 77 ms
71,548 KB
testcase_14 AC 249 ms
86,452 KB
testcase_15 AC 196 ms
83,568 KB
testcase_16 AC 116 ms
76,552 KB
testcase_17 AC 1,010 ms
114,372 KB
testcase_18 AC 142 ms
80,380 KB
testcase_19 AC 122 ms
76,696 KB
testcase_20 AC 244 ms
86,044 KB
testcase_21 AC 501 ms
93,996 KB
testcase_22 AC 311 ms
89,184 KB
testcase_23 AC 343 ms
91,220 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 79 ms
71,468 KB
testcase_35 AC 78 ms
71,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
xy=[]

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

    xy.append([x,y])
ans=0

dis=[]
for i in range(n-1):
    for j in range(i+1,n):
        dis.append([(xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2,i,j])
dis=sorted(dis)
erase=[0]*(n)
for i in range(len(dis)):
    if dis[i][1]==0:
        if erase[dis[i][2]]==0:
            ans+=1
            erase[dis[i][2]]=1
    else:
        if erase[dis[i][1]]==erase[dis[i][2]]==0:
            erase[dis[i][1]] = erase[dis[i][2]]=1

print(ans)
0