jzoj6284
题意
父亲节点较小的树期望高度。\(n\le 200\)
做法
令\(dp_{i,j}\)为\(i\)个点选出\(j\)个点组成的概率
\(dp_{i,j}=dp_{i-1,j-1}\times \frac{j-1}{i}+dp_{i-1,j}\times \frac{i-j}{i}\)
令\(f_{i,j}\)为\(i\)点组成高度为\(j\)的树
\(f_{i,j}=g_{i-1,j-1}\)
令\(g_{i,j}\)为\(i\)点组成最大高度为\(j\)的树的森林
\(g_{i,j}=\sum\limits_{k=1}^i dp_{i,k}\times f_{k,j}\times g_{i-k,j}\)