問題一覧 > 通常問題

No.2384 Permutations of Permutations

レベル : / AI推定難易度 : 2350 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 17
作問者 : 👑 箱星 / テスター : noshi91
お気に入りにしたユーザー ProblemId : 9226 / 自分の提出
問題文最終更新日: 2023-07-14 02:09:35
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 397 (群論コンテスト) (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。