結果
問題 |
No.806 木を道に
|
ユーザー |
![]() |
提出日時 | 2025-03-20 21:17:59 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 128 ms / 2,000 ms |
コード長 | 239 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 82,420 KB |
実行使用メモリ | 78,096 KB |
最終ジャッジ日時 | 2025-03-20 21:19:02 |
合計ジャッジ時間 | 3,830 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
n = int(input()) degrees = [0] * (n + 1) # 1-based for _ in range(n - 1): a, b = map(int, input().split()) degrees[a] += 1 degrees[b] += 1 result = 0 for d in degrees[1:]: if d > 2: result += d - 2 print(result)