1843D

CF1843D Apple Tree 题解

题意: 思路: 树形 $ dp $ : 设 $ cnt_u $ 表示以 $ u $ 为根的子树中叶子节点的数量,那么状态转移方程有: 当 $ u $ 为叶子节点时, $ cnt_u = 1 $ ; 当 $ u $ 不为叶子节点时, $ cnt_u = \sum_{i ∈ Son_u} cnt_{v_ ......
题解 1843D Apple 1843 Tree

Codeforces 1843D:Apple Tree

# [1843D.Apple Tree](https://codeforces.com/contest/1843/problem/D "Codeforces 1843D") ## Description: - 一棵树( $Tree$ 无环无重边 ) $n$ 个节点,根节点为1(节点编号 $1$~$n ......
Codeforces 1843D Apple 1843 Tree
共2篇  :1/1页 首页上一页1下一页尾页