先考虑给定 $f$,如何计算 $g=f^k$。假设 $f$ 是形式幂级数,我们可以利用 $g'f=kf'g$ 来计算,于是我们想定义狄利克雷卷积的导数,使其满足 $(fg)'=f'g+g'f$,便能推出相同的性质,从而快速计算。狄利克雷卷积其实就是多元多项式乘法。我们定义 $(x_1^{a_1}x_2^{a_2}\cdots x_n^{a_n})'=(a_1+a_2+\cdots +a_n)(x_1^{a_1}x_2^{a_2}\cdots x_n^{a_n})$,容易验证其具有我们想要的性质,且只会丢失常数项的信息。时间复杂度 $O(n\log n)$。
QOJ.ac
QOJ
As we are currently experiencing an overwhelming number of web requests for fetching user submissions, we have temporarily disabled the full submissions list. You must now be logged in to view submissions.
Discussion #216 for Problem #5040. Dirichlet $k$-th root
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-13 00:16:07
Last updated: 2025-12-13 00:16:09
题解
Comments
No comments yet.