結果

問題 No.806 木を道に
ユーザー Konton7
提出日時 2019-05-24 10:21:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-09-17 10:05:02
合計ジャッジ時間 5,848 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
connect_list = [0 for i in range(n)]
for i in range(n-1):
	a, b = [ int(v) for v in input().split() ]
	connect_list[a-1] += 1
	connect_list[b-1] += 1


s = 0
for i in connect_list:
	if i >= 2:
		s += i - 2
print(s)
0