不是很懂 题解 中的某些部分。
比如这一句
For the number of ways to choose their ending vertices, observe that it equals the number of rooted forests with NNN labeled vertices and ∣S∣\mid S\mid∣S∣ edges such that the set of vertices with a parent is SSS.
给一个我自己翻译的版本,有差错的希望能有高人指正一下。