結果

問題 No.806 木を道に
ユーザー sinsincoscos
提出日時 2019-02-24 15:33:09
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 179 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 67,556 KB
最終ジャッジ日時 2024-07-07 03:41:30
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

cnt = [0]*(N+1)
for i in range(N-1):
	a,b = map(int,input.split())
	cnt[a] += 1
	cnt[b] += 1

ans = 0
for i in range(N+1):
	ans += max(cnt[i+1]-2,0)

print(ans)
0