CF1310E.Strange Function
省选/NOI-
通过率:0%
时间限制:2.00s
内存限制:512MB
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.
我们定义多重集 a 的函数 f 为:对 a 中每个出现的数,统计其出现次数,所得所有出现次数构成的多重集。
例如,f(5,5,1,2,5,2,3,3,9,5)=1,1,2,2,4。
我们定义 fk(a) 为将函数 f 对数组 a 连续应用 k 次:fk(a)=f(fk−1(a)),且规定 f0(a)=a。
例如,f2(5,5,1,2,5,2,3,3,9,5)=1,2,2。
给定整数 n,k,你需要计算:当 a 取遍所有长度不超过 n 的非空数组(元素为任意整数)时,函数 fk(a) 最多能取多少个不同的值?答案对 998244353 取模。
输入格式
The first and only line of input consists of two integers n,k (1≤n,k≤2020).
输入仅有一行,包含两个整数 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.
输出一个数字——即对所有长度不超过 n 的非空数组,函数 fk(a) 所能取到的不同值的个数,结果对 998244353 取模。
输入输出样例
输入#1
3 1
输出#1
6
输入#2
5 6
输出#2
1
输入#3
10 1
输出#3
138
输入#4
10 2
输出#4
33
输入解题思路,AI测评打分。不知道怎么写?