No.1761 Sequence Distance
レベル :
/ AI推定難易度 : 2000
/ 実行時間制限 : 1ケース 8.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 18
作問者 :
PCTprobability
/ テスター :
NyaanNyaan
tokusakurai
タグ : / 解いたユーザー数 18
作問者 :
PCTprobability
/ テスター :
問題文最終更新日: 2021-11-20 20:46:17
English (AI translation)
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 324
(順位表)
の他の問題:
Problem Statement
Find the number, modulo $998244353$, of pairs of positive integer sequences $A,B$ that satisfy all of the following conditions.
- $A$ and $B$ have the same length.
- All elements of $A$ and all elements of $B$ are between $1$ and $N$, inclusive.
- Both $A$ and $B$ are strictly increasing.
- $\displaystyle \sum_{i=1}^{|A|} |A_i-B_i| = M$
Constraints
- All inputs are integers.
- $1 \le N \le 5000$
- $1 \le M \le 1000$
Input
$N\ M$
Output
Print the answer on $1$ line.
Sample
Sample 1
Input
4 3
Output
8
There are $8$ pairs that satisfy the conditions, such as $A=(1,2),B=(2,4)$ and $A=(1,2,3),B=(2,3,4)$.
Sample 2
Input
6 4
Output
136
Sample 3
Input
1234 987
Output
8555498
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。