結果

問題 No.1265 Balloon Survival
ユーザー taiga000629taiga000629
提出日時 2020-10-24 01:14:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,096 ms / 2,000 ms
コード長 530 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 86,608 KB
実行使用メモリ 151,436 KB
最終ジャッジ日時 2023-09-28 19:55:55
合計ジャッジ時間 16,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,184 KB
testcase_01 AC 77 ms
71,236 KB
testcase_02 AC 74 ms
71,428 KB
testcase_03 AC 73 ms
71,380 KB
testcase_04 AC 75 ms
71,260 KB
testcase_05 AC 75 ms
71,024 KB
testcase_06 AC 75 ms
71,324 KB
testcase_07 AC 75 ms
70,872 KB
testcase_08 AC 76 ms
71,076 KB
testcase_09 AC 73 ms
71,356 KB
testcase_10 AC 74 ms
71,404 KB
testcase_11 AC 75 ms
71,232 KB
testcase_12 AC 75 ms
71,332 KB
testcase_13 AC 75 ms
71,416 KB
testcase_14 AC 170 ms
86,740 KB
testcase_15 AC 129 ms
79,064 KB
testcase_16 AC 99 ms
76,420 KB
testcase_17 AC 518 ms
123,344 KB
testcase_18 AC 109 ms
77,644 KB
testcase_19 AC 100 ms
76,828 KB
testcase_20 AC 164 ms
86,692 KB
testcase_21 AC 256 ms
93,700 KB
testcase_22 AC 204 ms
92,296 KB
testcase_23 AC 218 ms
92,812 KB
testcase_24 AC 1,095 ms
151,284 KB
testcase_25 AC 1,096 ms
151,200 KB
testcase_26 AC 1,017 ms
151,240 KB
testcase_27 AC 1,023 ms
151,212 KB
testcase_28 AC 1,015 ms
151,356 KB
testcase_29 AC 1,067 ms
151,384 KB
testcase_30 AC 1,072 ms
151,028 KB
testcase_31 AC 1,023 ms
151,276 KB
testcase_32 AC 1,090 ms
151,436 KB
testcase_33 AC 1,022 ms
151,144 KB
testcase_34 AC 77 ms
71,232 KB
testcase_35 AC 76 ms
71,232 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,key=lambda x: x[0])
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