結果

問題 No.806 木を道に
ユーザー convexineq
提出日時 2021-04-06 08:21:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 82,908 KB
実行使用メモリ 77,752 KB
最終ジャッジ日時 2025-01-02 15:46:26
合計ジャッジ時間 3,630 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
deg = [0]*n
for _ in range(n-1):
    a,b = map(int,input().split())
    deg[a-1] += 1
    deg[b-1] += 1
print(deg.count(1) - 2)
0