No.2384 Permutations of Permutations
Problem Statement
Let $S$ be the set of all bijections on $\{1,2,\ldots,N\}$, and let $\mathcal{T}$ be the set of bijections $F$ on $S$ satisfying the following.
- For any $f_1,f_2\in S$, $F(f_2\circ f_1)=F(f_2)\circ F(f_1)$
Find the number, modulo $998244353$, of elements $F$ of $\mathcal{T}$ satisfying the following condition.
Condition: When $f\in S$ is defined by $$ f(x)=\begin{cases} x+1 & (1\le x\lt K) \\ 1 & (x=K) \\ x & (K\lt x\le N) \end{cases} $$ the following holds: $$ \begin{align*} F(f)(x) &= x+1 \quad (1\le x\lt K) \\ F(f)(K) &= 1 \end{align*} $$
Constraints
- $2\le N\le 10^5$
- $2\le K\le N$
- All inputs are integers.
Input
$N$ $K$
Output
Output the number, modulo $998244353$, of elements $F$ of $\mathcal{T}$ satisfying the condition.
Sample
Sample 1
Input
3 2
Output
2
$f\in S$ is the bijection satisfying $f(1)=2, f(2)=1, f(3)=3$.
Sample 2
Input
1742 641
Output
990581483
Output the answer modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
noshi91