結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,752 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 25 ms
10,880 KB
testcase_03 AC 24 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 27 ms
10,880 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 26 ms
10,752 KB
testcase_08 AC 25 ms
10,880 KB
testcase_09 AC 26 ms
10,880 KB
testcase_10 AC 25 ms
10,752 KB
testcase_11 AC 25 ms
10,752 KB
testcase_12 AC 27 ms
10,752 KB
testcase_13 AC 27 ms
10,880 KB
testcase_14 AC 131 ms
19,072 KB
testcase_15 AC 100 ms
16,640 KB
testcase_16 AC 52 ms
12,800 KB
testcase_17 AC 647 ms
50,712 KB
testcase_18 AC 64 ms
13,952 KB
testcase_19 AC 54 ms
13,056 KB
testcase_20 AC 127 ms
18,944 KB
testcase_21 AC 279 ms
29,720 KB
testcase_22 AC 162 ms
22,144 KB
testcase_23 AC 180 ms
23,296 KB
testcase_24 AC 1,370 ms
86,516 KB
testcase_25 AC 1,392 ms
87,280 KB
testcase_26 AC 1,475 ms
87,184 KB
testcase_27 AC 1,357 ms
87,160 KB
testcase_28 AC 1,360 ms
87,128 KB
testcase_29 AC 1,332 ms
87,260 KB
testcase_30 AC 1,359 ms
87,388 KB
testcase_31 AC 1,414 ms
87,284 KB
testcase_32 AC 1,364 ms
87,152 KB
testcase_33 AC 1,383 ms
87,152 KB
testcase_34 AC 28 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