結果

問題 No.1265 Balloon Survival
ユーザー taiga000629taiga000629
提出日時 2020-10-24 00:31:45
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 507 bytes
コンパイル時間 1,106 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 137,236 KB
最終ジャッジ日時 2023-09-28 19:41:54
合計ジャッジ時間 27,445 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,220 KB
testcase_01 AC 83 ms
70,852 KB
testcase_02 AC 81 ms
71,156 KB
testcase_03 AC 80 ms
71,244 KB
testcase_04 AC 81 ms
71,160 KB
testcase_05 AC 81 ms
71,160 KB
testcase_06 AC 81 ms
71,108 KB
testcase_07 AC 81 ms
70,976 KB
testcase_08 AC 83 ms
71,112 KB
testcase_09 AC 80 ms
71,388 KB
testcase_10 AC 79 ms
71,264 KB
testcase_11 AC 81 ms
71,356 KB
testcase_12 AC 85 ms
71,088 KB
testcase_13 AC 82 ms
71,080 KB
testcase_14 AC 254 ms
85,712 KB
testcase_15 AC 205 ms
83,240 KB
testcase_16 AC 120 ms
76,172 KB
testcase_17 AC 1,008 ms
112,024 KB
testcase_18 AC 147 ms
80,040 KB
testcase_19 AC 122 ms
76,332 KB
testcase_20 AC 243 ms
85,724 KB
testcase_21 AC 490 ms
93,832 KB
testcase_22 AC 300 ms
88,744 KB
testcase_23 AC 333 ms
90,084 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 81 ms
71,008 KB
testcase_35 AC 79 ms
71,328 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.sort()
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