307154: CF1310E. Strange Function

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Strange Function

题意翻译

对于一个多重集合$a$ 我们定义$f(a)$为每个数字出现的次数的多重集合 现在给你$n$和$k$,求对于所有大小小于等于 $n$的初始多重集合$a$,$f^k(a)$有多少种不同的可能,答案对$998244353$取模。 $1\leq n,k\leq 2020$ by user_101868

题目描述

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 $ f^k(a) $ , as applying $ f $ to array $ a $ $ k $ times: $ f^k(a) = f(f^{k-1}(a)), f^0(a) = a $ . E.g., $ f^2(\{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 $ f^k(a) $ can have, where $ a $ is arbitrary non-empty array with numbers of size no more than $ n $ . Print the answer modulo $ 998\,244\,353 $ .

输入输出格式

输入格式


The first and only line of input consists of two integers $ n, k $ ( $ 1 \le n, k \le 2020 $ ).

输出格式


Print one number — the number of different values of function $ f^k(a) $ on all possible non-empty arrays with no more than $ n $ elements modulo $ 998\,244\,353 $ .

输入输出样例

输入样例 #1

3 1

输出样例 #1

6

输入样例 #2

5 6

输出样例 #2

1

输入样例 #3

10 1

输出样例 #3

138

输入样例 #4

10 2

输出样例 #4

33

Input

题意翻译

对于一个多重集合$a$ 我们定义$f(a)$为每个数字出现的次数的多重集合 现在给你$n$和$k$,求对于所有大小小于等于 $n$的初始多重集合$a$,$f^k(a)$有多少种不同的可能,答案对$998244353$取模。 $1\leq n,k\leq 2020$ by user_101868

加入题单

上一题 下一题 算法标签: