【题解】P8735 [蓝桥杯 2020 国 A] 蓝跳跳

https://www.luogu.com.cn/problem/P8735

设 \(a=p-1,b=k-p+1\)。
则转移可以选择 \(a\),或者 \(b,a\)。
\(F=F(\sum_{i=1}^{a} x^i)(1+\sum_{i=a+1}^{a+b}x^i)+1\),然后我们求 \([x^n] F(1+\sum_{i=a+1}^{a+b} x^i)\),那么直接 bostan-mori,\(O(k^2\log n)\)。

posted @ 2026-12-06 14:29  TallBanana  阅读(3)  评论(0)    收藏  举报