CF1310E.Strange Function
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Let's define the function f of multiset a as the multiset of number of occurences of every number, that is present in a .
E.g., f({5,5,1,2,5,2,3,3,9,5})={1,1,2,2,4} .
Let's define fk(a) , as applying f to array a k times: fk(a)=f(fk−1(a)),f0(a)=a .
E.g., f2({5,5,1,2,5,2,3,3,9,5})={1,2,2} .
You are given integers n,k and you are asked how many different values the function fk(a) can have, where a is arbitrary non-empty array with numbers of size no more than n . Print the answer modulo 998244353 .
输入格式
The first and only line of input consists of two integers n,k ( 1≤n,k≤2020 ).
输出格式
Print one number — the number of different values of function fk(a) on all possible non-empty arrays with no more than n elements modulo 998244353 .
输入输出样例
输入#1
3 1
输出#1
6
输入#2
5 6
输出#2
1
输入#3
10 1
输出#3
138
输入#4
10 2
输出#4
33