Combinatorics related exercises

Combinatorics related exercises

1.Count The Blocks

Portal Title: the ECR 84 E
meaning of the questions: Given n, find from 0 to 10 ^ n-1 is the length of all i (i from 1 to n) number. N are each the number of digits (if less than the leading 0)

Here Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture Description

The following codes on

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5,mod=998244353;
ll f[N],n; 
int main(){
	cin>>n;
	f[0]=1;
	for(int i=1;i<=n;i++) f[i]=(f[i-1]*10)%mod;
	for(int i=1;i<n;i++) printf("%lld ",(18*f[n-i]+81*f[n-i-1]*(n-i-1))%mod);
	puts("10");
	return 0;
}

Published 18 original articles · won praise 14 · views 355

Guess you like

Origin blog.csdn.net/weixin_45750972/article/details/105066535