結果

問題 No.1265 Balloon Survival
ユーザー _matumo__matumo_
提出日時 2021-01-05 00:14:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,435 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 87,260 KB
最終ジャッジ日時 2024-04-23 08:57:33
合計ジャッジ時間 17,712 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 28 ms
10,624 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 27 ms
10,624 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 27 ms
10,880 KB
testcase_10 AC 27 ms
10,752 KB
testcase_11 AC 25 ms
10,752 KB
testcase_12 AC 29 ms
10,752 KB
testcase_13 AC 25 ms
10,624 KB
testcase_14 AC 131 ms
18,944 KB
testcase_15 AC 103 ms
16,512 KB
testcase_16 AC 53 ms
12,800 KB
testcase_17 AC 704 ms
50,712 KB
testcase_18 AC 68 ms
13,696 KB
testcase_19 AC 57 ms
12,928 KB
testcase_20 AC 131 ms
18,816 KB
testcase_21 AC 306 ms
29,588 KB
testcase_22 AC 179 ms
22,144 KB
testcase_23 AC 199 ms
23,168 KB
testcase_24 AC 1,407 ms
86,388 KB
testcase_25 AC 1,426 ms
87,152 KB
testcase_26 AC 1,412 ms
87,260 KB
testcase_27 AC 1,399 ms
87,156 KB
testcase_28 AC 1,398 ms
87,208 KB
testcase_29 AC 1,435 ms
87,260 KB
testcase_30 AC 1,426 ms
87,132 KB
testcase_31 AC 1,398 ms
87,024 KB
testcase_32 AC 1,405 ms
87,028 KB
testcase_33 AC 1,405 ms
87,156 KB
testcase_34 AC 26 ms
10,752 KB
testcase_35 AC 26 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
p=[[int(a) for a in input().split()] for i in [0]*N]
q=[]
for i,(xi,yi) in enumerate(p[:-1]):
	for j in range(i+1,N):
		xj,yj=p[j]
		r=(xi-xj)**2+(yi-yj)**2
		q.append((r,i,j))
q.sort()
v=[0]*N
n=0
for r,i,j in q:
	if v[i] or v[j]:continue
	v[j]=1
	if i>0:v[i]=1
	else:n+=1
print(n)
0