摘要: 第一类斯特林数 \[ \large \begin{bmatrix}n\\ m\end{bmatrix}=(n-1)\begin{bmatrix}n-1\\ m\end{bmatrix}+\begin{bmatrix}n-1\\ m-1\end{bmatrix} \] 其为将 \(n\) 个元素划分为 阅读全文
posted @ 2020-12-25 22:30 lhm_liu 阅读(293) 评论(2) 推荐(1) 编辑
摘要: #388. 【UNR #3】配对树 先考虑怎样配对最优,发现对于一条边,若其两端的子树内需要配对的点的个数都为奇数,则该边会有 \(1\) 的贡献,否则没有贡献,得这样为最优情况。 那么对于一棵子树,将其内部的点标记为 \(1\),得到一个 \(01\) 串,子树父边的贡献为 \(01\) 串中长度 阅读全文
posted @ 2020-12-25 21:14 lhm_liu 阅读(52) 评论(0) 推荐(0) 编辑