結果
| 問題 |
No.806 木を道に
|
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2019-05-11 18:33:03 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 588 ms / 2,000 ms |
| コード長 | 306 bytes |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 53,600 KB |
| 最終ジャッジ日時 | 2024-07-02 01:16:38 |
| 合計ジャッジ時間 | 7,884 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
N = int(input())
buff = {}
for n in range(1, N+1):
buff[n] = set()
for n in range(N-1):
a, b = map(int, input().split())
buff[a].add(b)
buff[b].add(a)
change_num = 0
for key, vals in buff.items():
if len(vals) >= 2:
change_num += len(vals) - 2
#print(buff)
print(change_num)
💕💖💞