CF1789F Serval and Brain Power 题解报告。

· · 题解

k 为循环节个数。

然后就做完了?综合时间复杂度 \mathcal{O}(n^3+n^5+n^2\times 2^{16})