結果
問題 | No.806 木を道に |
ユーザー |
![]() |
提出日時 | 2019-03-22 22:54:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 290 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,520 KB |
最終ジャッジ日時 | 2024-09-19 06:21:12 |
合計ジャッジ時間 | 4,556 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N = int(input()) adj = [[] for _ in range(N)] for _ in range(N-1): a, b = map(lambda x: int(x)-1, input().split()) adj[a].append(b) adj[b].append(a) ans = 0 for l in adj: ans += max(0, len(l)-2) print(ans)