結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:33:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,641 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 959 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 155,288 KB
最終ジャッジ日時 2023-09-03 21:33:28
合計ジャッジ時間 22,141 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,480 KB
testcase_01 AC 69 ms
71,668 KB
testcase_02 AC 68 ms
71,240 KB
testcase_03 AC 68 ms
71,580 KB
testcase_04 AC 70 ms
71,468 KB
testcase_05 AC 70 ms
71,456 KB
testcase_06 AC 70 ms
71,616 KB
testcase_07 AC 71 ms
71,460 KB
testcase_08 AC 69 ms
71,324 KB
testcase_09 AC 69 ms
71,196 KB
testcase_10 AC 69 ms
71,592 KB
testcase_11 AC 68 ms
71,588 KB
testcase_12 AC 69 ms
71,240 KB
testcase_13 AC 69 ms
71,192 KB
testcase_14 AC 199 ms
80,368 KB
testcase_15 AC 162 ms
78,952 KB
testcase_16 AC 104 ms
76,484 KB
testcase_17 AC 753 ms
102,300 KB
testcase_18 AC 124 ms
77,596 KB
testcase_19 AC 109 ms
76,376 KB
testcase_20 AC 197 ms
80,628 KB
testcase_21 AC 399 ms
91,944 KB
testcase_22 AC 258 ms
91,068 KB
testcase_23 AC 275 ms
92,912 KB
testcase_24 AC 1,578 ms
153,944 KB
testcase_25 AC 1,599 ms
154,656 KB
testcase_26 AC 1,614 ms
155,136 KB
testcase_27 AC 1,611 ms
154,900 KB
testcase_28 AC 1,596 ms
155,288 KB
testcase_29 AC 1,636 ms
155,192 KB
testcase_30 AC 1,621 ms
155,260 KB
testcase_31 AC 1,629 ms
154,788 KB
testcase_32 AC 1,641 ms
154,756 KB
testcase_33 AC 1,596 ms
154,536 KB
testcase_34 AC 71 ms
71,384 KB
testcase_35 AC 71 ms
71,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
p=[tuple(map(int,input().split())) for _ in range(n)]
a=[]
for i in range(n):
    for j in range(i+1,n):
        d=(p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2
        a.append((d,i,j))
a.sort()
ans=0
used=[False]*n
for dst,i,j in a:
    if i==0:
        if not used[j]:
            ans+=1
            used[j]=True
    elif not used[j] and not used[i]:
        used[i]=used[j]=True
print(ans)
0