問題一覧 > 通常問題

No.2048 L(I+D)S

レベル : / AI推定難易度 : 2300 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 49
作問者 : 👑 箱星 / テスター : akakimidori 👑 hitonanode
お気に入りにしたユーザー ProblemId : 8351 / 自分の提出
問題文最終更新日: 2022-10-16 23:37:43
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 357 (順位表) の他の問題:

Problem Statement

Find the number, modulo $998244353$, of permutations of $1,2,\ldots,N$ such that the sum of the length of the longest increasing subsequence and the length of the longest decreasing subsequence equals $N$.

Constraints

  • $N$ is an integer satisfying $1\le N\le 10^5$

Input

$N$

Output

Output the number of permutations satisfying the condition, modulo $998244353$.

Sample

Sample 1
Input
4
Output
4

$(2,1,4,3),(2,4,1,3),(3,1,4,2),(3,4,1,2)$ satisfy the condition.

Sample 2
Input
2
Output
0

Sample 3
Input
2143
Output
634982576

Output the answer modulo $998244353$.

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