結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:37:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,739 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 1,233 ms
コンパイル使用メモリ 86,444 KB
実行使用メモリ 134,568 KB
最終ジャッジ日時 2023-09-03 21:42:24
合計ジャッジ時間 22,845 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,168 KB
testcase_01 AC 76 ms
71,160 KB
testcase_02 AC 75 ms
71,004 KB
testcase_03 AC 75 ms
71,196 KB
testcase_04 AC 73 ms
71,232 KB
testcase_05 AC 74 ms
70,928 KB
testcase_06 AC 72 ms
71,312 KB
testcase_07 AC 75 ms
71,136 KB
testcase_08 AC 73 ms
70,772 KB
testcase_09 AC 75 ms
71,196 KB
testcase_10 AC 75 ms
70,768 KB
testcase_11 AC 75 ms
71,080 KB
testcase_12 AC 76 ms
71,156 KB
testcase_13 AC 74 ms
71,252 KB
testcase_14 AC 208 ms
79,980 KB
testcase_15 AC 169 ms
78,712 KB
testcase_16 AC 109 ms
76,240 KB
testcase_17 AC 818 ms
102,820 KB
testcase_18 AC 129 ms
77,272 KB
testcase_19 AC 112 ms
76,476 KB
testcase_20 AC 203 ms
79,828 KB
testcase_21 AC 429 ms
95,448 KB
testcase_22 AC 253 ms
81,616 KB
testcase_23 AC 276 ms
82,344 KB
testcase_24 AC 1,729 ms
132,580 KB
testcase_25 AC 1,694 ms
133,332 KB
testcase_26 AC 1,701 ms
134,496 KB
testcase_27 AC 1,718 ms
133,648 KB
testcase_28 AC 1,714 ms
134,568 KB
testcase_29 AC 1,727 ms
134,356 KB
testcase_30 AC 1,709 ms
134,516 KB
testcase_31 AC 1,723 ms
133,704 KB
testcase_32 AC 1,739 ms
133,492 KB
testcase_33 AC 1,708 ms
133,672 KB
testcase_34 AC 75 ms
71,132 KB
testcase_35 AC 72 ms
71,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
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