No.2079 aaabbc
タグ : / 解いたユーザー数 123
作問者 :
taiga0629kyopro
/ テスター :
👑 Problem Statement
Taiga, who is studying mathematics, came across the following problem.
How many ways are there to arrange the $6$ letters a, a, a, b, b, c in $1$ row?
The answer to this problem is $\displaystyle \frac{6!}{3!2!1!}=60$ ways. Now, solve the following problem.
For every tuple of non-negative integers $(A,B,C)$ satisfying $A+B+C=N$, compute $\displaystyle \frac{N!}{A!B!C!}$, and find the sum of these values. Since the answer is an integer, print the answer modulo $998244353$.
Input
$N$
Output
Print the answer modulo $998244353$.
Sample
Sample 1
Input
1
Output
3
The possible values of $(A,B,C)$ are the $3$ tuples $(1,0,0), (0,1,0), (0,0,1)$. Therefore, the answer is $\frac{1!}{1!0!0!}+\frac{1!}{0!1!0!}+\frac{1!}{0!0!1!}=3$.
Sample 2
Input
62
Output
101208447
Sample 3
Input
100
Output
578373382
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。