传送门
解析:
如果不会求导和积分的基础的话就去自学吧。
首先明确一点,模意义下只能表示有理数,所以能够对多项式求 L n Ln Ln的前提就是 A 0 = 1 A_0=1 A0=1
现在解这个方程,两边同时求导:
B
(
x
)
=
F
(
A
(
x
)
)
,
F
(
x
)
=
ln
(
x
)
B
′
(
x
)
=
F
′
(
A
(
x
)
)
A
′
(
x
)
B(x)=F(A(x)),F(x)=\ln(x)\\ B^\prime(x)=F^\prime(A(x))A^\prime(x)
B(x)=F(A(x)),F(x)=ln(x)B′(x)=F′(A(x))A′(x)
由于 ln ( x ) ′ = 1 x \ln(x)^\prime=\frac{1}x ln(x)′=x1,所以我们有:
B ( x ) = ∫ A ′ ( x ) A ( x ) d x B(x)=\int\frac{A^\prime(x)}{A(x)}\text{d}x B(x)=∫A(x)A′(x)dx
所以对 A A A求导求逆,再乘起来求不定积分就行了。
代码:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define re register
#define gc get_char
#define cs const
namespace IO{
inline char get_char(){
static cs int Rlen=1<<20|1;
static char buf[Rlen],*p1,*p2;
return (p1==p2)&&(p2=(p1=buf)+fread(buf,1,Rlen,stdin),p1==p2)?EOF:*p1++;
}
inline int getint(){
re char c;
while(!isdigit(c=gc()));re int num=c^48;
while(isdigit(c=gc()))num=(num+(num<<2)<<1)+(c^48);
return num;
}
}
using namespace IO;
cs int mod=998244353;
inline int add(int a,int b){return a+b>=mod?a+b-mod:a+b;}
inline int dec(int a,int b){return a<b?a-b+mod:a-b;}
inline int mul(int a,int b){return (ll)a*b%mod;}
inline int quickpow(int a,int b,int res=1){
while(b){
if(b&1)res=mul(res,a);
a=mul(a,a);
b>>=1;
}
return res;
}
cs int N=410000;
int inv[N],r[N];
inline void NTT(int *A,int n,int typ){
for(int re i=0;i<n;++i)if(i<r[i])swap(A[i],A[r[i]]);
for(int re i=1;i<n;i<<=1){
int wn=quickpow(typ==-1?(mod+1)/3:3,(mod-1)/i/2);
for(int re j=0;j<n;j+=i<<1)
for(int re k=0,x,y,w=1;k<i;++k,w=mul(w,wn)){
x=A[j+k],y=mul(w,A[j+k+i]);
A[j+k]=add(x,y);
A[j+k+i]=dec(x,y);
}
}
if(typ==-1)for(int re i=0;i<n;++i)A[i]=mul(A[i],inv[n]);
}
inline void Inv(int deg,int *a,int *b){
static int c[N];
if(deg==1){b[0]=quickpow(a[0],mod-2);return ;}
Inv((deg+1)>>1,a,b);
int re len=1;
while(len<(deg<<1))len<<=1;
for(int re i=0;i<len;++i)r[i]=(r[i>>1]>>1)|((i&1)*(len>>1));
memcpy(c,a,sizeof(int)*deg);
memset(c+deg,0,sizeof(int)*(len-deg));
NTT(c,len,1),NTT(b,len,1);
for(int re i=0;i<len;++i)b[i]=mul(dec(2,mul(b[i],c[i])),b[i]);
NTT(b,len,-1);
memset(b+deg,0,sizeof(int)*(len-deg));
}
inline void deriv(int *A,int *B,int len){
for(int re i=1;i<len;++i)B[i-1]=mul(i,A[i]),B[len-1]=0;
}
inline void integ(int *A,int *B,int len){
for(int re i=1;i<len;++i)B[i]=mul(A[i-1],inv[i]),B[0]=0;
}
inline void Ln(int deg,int *f,int *g){
static int a[N],b[N];
deriv(f,a,deg);
Inv(deg,f,b);
int re len=1;
while(len<(deg<<1))len<<=1;
for(int re i=0;i<len;++i)r[i]=(r[i>>1]>>1)|((i&1)*(len>>1));
NTT(a,len,1),NTT(b,len,1);
for(int re i=0;i<len;++i)a[i]=mul(a[i],b[i]);
NTT(a,len,-1);
integ(a,g,len);
memset(g+deg,0,sizeof(int)*(len-deg));
}
inline void init_inv(){
inv[0]=inv[1]=1;
for(int re i=2;i<N;++i)inv[i]=mul(mod-mod/i,inv[mod%i]);
}
int f[N],g[N],n;
signed main(){
init_inv();
n=getint();
for(int re i=0;i<n;++i)f[i]=getint();
Ln(n,f,g);
for(int re i=0;i<n;++i)cout<<g[i]<<" ";
return 0;
}