CF526G Spiders Evil Plan

yhx's blog

很神的一个题,重链剖分。

贪心地选择最长的,第二长的.......

然后发现有可能不包含 \(x\) ,于是分情况讨论,这个是这道题的重点。

相关文章: