题解 CF1327E 【Count The Blocks】
计算贡献。
假设知道有一个长度为
如果
如果这个串的左端点为
(
否则:
(
可以发现,我们可以枚举
对于第一种情况,特判
第二种情况在每一种
#include<bits/stdc++.h>
using namespace std;
#define re register
#define int long long
#define M 998244353
inline int read(){
re int t=0;
re char v=getchar();
while(v<'0')v=getchar();
while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
return t;
}
int t,n,m,k,x,jc[400002],ans;
signed main(){
n=read();jc[0]=1;for(re int i=1;i<=n*2;++i)jc[i]=jc[i-1]*10%M;
for(re int i=1;i<=n;++i){
ans=0;
if(i==n)ans+=10;
else if(i==n-1)ans+=180;
else{
ans+=(n-i-1)*jc[n-i-2]%M*810ll%M;
ans+=jc[n-i-1]*180ll%M;
}
printf("%lld ",ans%M);
}
}