K多项式求导VJ

在这里插入图片描述在这里插入图片描述

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    long long  re[110],a[110];
    a[0] = 0;
    for(int i=1; i<=n+1; i++)
    {
        cin>>a[i];
    }
    for(int i=1; i<=n+1; i++)
    {
        re[i]=n-i+1;
    }
    for(int j=1; j<=k; j++)
    {
        for(int i=n+1; i>=1; i--)
        {
            a[i]=(a[i-1]*re[i-1])%998244353;
        }
    }
    for(int i=1; i<=n+1; i++)
    {
        if(i==n+1)
        {
            cout<<a[i]<<endl;
        }
        else
        {
            cout<<a[i]<<" ";
        }
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/king9666/article/details/89811290