結果

問題 No.1265 Balloon Survival
ユーザー _matumo__matumo_
提出日時 2021-01-04 23:02:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,411 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 87,388 KB
最終ジャッジ日時 2024-04-23 07:59:31
合計ジャッジ時間 17,530 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 26 ms
10,880 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 24 ms
10,880 KB
testcase_05 AC 26 ms
10,880 KB
testcase_06 AC 26 ms
10,880 KB
testcase_07 AC 26 ms
10,880 KB
testcase_08 AC 25 ms
10,752 KB
testcase_09 AC 24 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 26 ms
10,752 KB
testcase_14 AC 130 ms
19,072 KB
testcase_15 AC 103 ms
16,640 KB
testcase_16 AC 52 ms
12,800 KB
testcase_17 AC 653 ms
50,836 KB
testcase_18 AC 65 ms
13,824 KB
testcase_19 AC 54 ms
13,056 KB
testcase_20 AC 132 ms
18,944 KB
testcase_21 AC 289 ms
29,596 KB
testcase_22 AC 170 ms
22,144 KB
testcase_23 AC 187 ms
23,296 KB
testcase_24 AC 1,411 ms
86,380 KB
testcase_25 AC 1,380 ms
87,272 KB
testcase_26 AC 1,403 ms
87,260 KB
testcase_27 AC 1,403 ms
87,276 KB
testcase_28 AC 1,393 ms
87,388 KB
testcase_29 AC 1,399 ms
87,384 KB
testcase_30 AC 1,384 ms
87,260 KB
testcase_31 AC 1,386 ms
87,144 KB
testcase_32 AC 1,380 ms
87,144 KB
testcase_33 AC 1,375 ms
87,144 KB
testcase_34 AC 27 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 range(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