結果

問題 No.1265 Balloon Survival
ユーザー taiga000629taiga000629
提出日時 2020-10-24 00:29:13
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 507 bytes
コンパイル時間 1,424 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 137,468 KB
最終ジャッジ日時 2023-09-28 19:38:30
合計ジャッジ時間 28,528 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,236 KB
testcase_01 AC 75 ms
71,156 KB
testcase_02 AC 75 ms
71,152 KB
testcase_03 AC 73 ms
71,292 KB
testcase_04 AC 76 ms
71,204 KB
testcase_05 AC 77 ms
71,376 KB
testcase_06 AC 76 ms
71,240 KB
testcase_07 AC 76 ms
71,272 KB
testcase_08 AC 76 ms
71,200 KB
testcase_09 AC 78 ms
71,456 KB
testcase_10 AC 76 ms
71,536 KB
testcase_11 AC 77 ms
71,312 KB
testcase_12 AC 76 ms
71,476 KB
testcase_13 AC 76 ms
71,304 KB
testcase_14 AC 249 ms
85,824 KB
testcase_15 AC 198 ms
83,132 KB
testcase_16 AC 116 ms
76,332 KB
testcase_17 AC 1,007 ms
112,240 KB
testcase_18 AC 144 ms
80,240 KB
testcase_19 AC 121 ms
76,376 KB
testcase_20 AC 241 ms
85,912 KB
testcase_21 AC 494 ms
93,924 KB
testcase_22 AC 301 ms
89,072 KB
testcase_23 AC 326 ms
90,212 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 78 ms
71,072 KB
testcase_35 AC 78 ms
71,256 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