結果

問題 No.806 木を道に
ユーザー もりを
提出日時 2019-03-22 21:35:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 357 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-09-19 02:55:07
合計ジャッジ時間 5,626 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
arr = [0] * (100100)
for i in range(n - 1):
    a,b = map(int,input().split())
    arr[a] += 1
    arr[b] += 1
mx = 0
for i in arr:
    if i > 2:
        mx += i - 2
print(max(0, mx))
0