結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:27:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,820 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 154,928 KB
最終ジャッジ日時 2023-09-03 21:17:05
合計ジャッジ時間 25,256 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,156 KB
testcase_01 AC 75 ms
71,008 KB
testcase_02 AC 75 ms
71,148 KB
testcase_03 AC 76 ms
71,172 KB
testcase_04 AC 76 ms
71,000 KB
testcase_05 AC 76 ms
71,308 KB
testcase_06 AC 76 ms
71,004 KB
testcase_07 AC 75 ms
71,116 KB
testcase_08 AC 79 ms
71,160 KB
testcase_09 AC 75 ms
71,304 KB
testcase_10 AC 74 ms
71,100 KB
testcase_11 AC 78 ms
71,260 KB
testcase_12 AC 77 ms
71,264 KB
testcase_13 AC 77 ms
71,180 KB
testcase_14 AC 209 ms
80,216 KB
testcase_15 AC 171 ms
78,484 KB
testcase_16 AC 110 ms
76,288 KB
testcase_17 AC 794 ms
101,712 KB
testcase_18 AC 128 ms
77,132 KB
testcase_19 AC 114 ms
76,372 KB
testcase_20 AC 206 ms
80,212 KB
testcase_21 AC 416 ms
92,936 KB
testcase_22 AC 279 ms
91,096 KB
testcase_23 AC 304 ms
92,380 KB
testcase_24 AC 1,776 ms
153,200 KB
testcase_25 AC 1,771 ms
154,564 KB
testcase_26 AC 1,768 ms
154,828 KB
testcase_27 AC 1,775 ms
154,460 KB
testcase_28 AC 1,762 ms
154,772 KB
testcase_29 AC 1,820 ms
154,928 KB
testcase_30 AC 1,788 ms
154,616 KB
testcase_31 AC 1,792 ms
154,316 KB
testcase_32 AC 1,797 ms
154,464 KB
testcase_33 AC 1,779 ms
154,332 KB
testcase_34 AC 77 ms
71,184 KB
testcase_35 AC 77 ms
71,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
p=[list(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
t=set()
for dst,i,j in a:
    if i in t or j in t:
        continue
    if i==0:
        ans+=1
        t.add(j)
    else:
        t.add(i)
        t.add(j)
print(ans)
0