問題一覧 > 通常問題

No.1960 Guruguru Permutation

レベル : / AI推定難易度 : 2000 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 54
作問者 : PCTprobability / テスター : 👑 tute7627
お気に入りにしたユーザー ProblemId : 7827 / 自分の提出
問題文最終更新日: 2022-05-27 21:19:44
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 345 (順位表) の他の問題:

Problem Statement

Among the permutations $P_1,P_2,...,P_N$ of length $N$, find the number of those satisfying the following conditions, $\bmod 998244353$.

  • For any pair of integers $(i,j)$ satisfying $1 \le i < j \le M$, it never holds that $P_{P_{P_{..._{P_i}}}} = j$.
  • For any pair of integers $(i,j)$ satisfying $N-K+1 \le i < j \le N$, it never holds that $P_{P_{P_{..._{P_i}}}} = j$.

Input

$N\ M\ K$

  • All inputs are integers.
  • $1 \le N \le 2 \times 10^5$
  • $0 \le M,K \le N$

Output

Output the number of permutations satisfying the conditions, $\bmod 998244353$.

Sample

Sample 1
Input
3 2 0
Output
3

$P=(1,2,3),(1,3,2),(3,2,1)$ satisfy the conditions.

$P=(3,1,2)$ does not satisfy the conditions because $P_{P_1}=2$.

Sample 2
Input
7 2 3
Output
546

Sample 3
Input
2022 5 20
Output
891506475

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。