結果
問題 | No.806 木を道に |
ユーザー |
![]() |
提出日時 | 2019-12-08 22:28:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 325 ms / 2,000 ms |
コード長 | 166 bytes |
コンパイル時間 | 561 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2025-01-01 17:55:09 |
合計ジャッジ時間 | 6,785 ms |
ジャッジサーバーID (参考情報) |
judge7 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
N = int(input()) D = [0] * N c = 0 for i in range(N-1): a, b = map(int, input().split()) D[a-1] += 1 D[b-1] += 1 for d in D: c += max(d-2,0) print(c)