Universal Cup Judging System

Universal Cup

시간 제한: 7.0 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓
통계

長さ $n$ の配列 $a$ に対する次の操作を考えます。添字 $i$ ($1 \le i < n$) を選び、次のように操作します。

  • $a_i = a_{i+1}$ ならば、$a_i$ と $a_{i+1}$ を両方とも $1$ 減らします。
  • そうでなければ、$a_i$ と $a_{i+1}$ のうち小さい方を $1$ 減らします。

配列のすべての要素は常に非負でなければならないため、どの要素も負にならない場合にのみ操作を行えます。

この操作を任意の回数($0$ 回でもよい)行うことで、すべての要素を $0$ にできる配列 $a$ を 良い配列 と呼びます。

$n$ と $k$ が与えられます。すべての $i$ について $0 \le a_i \le k$ を満たす長さ $n$ の良い配列 $a$ の個数を、$998\,244\,353$ を法として求めてください。

入力

唯一の行に、$2$ つの整数 $n$ と $k$ ($1 \le n, k \le 250\,000$) が与えられます。

出力

良い配列の個数を $998\,244\,353$ で割った余りを、$1$ つの整数として出力してください。

入出力例

入力 1

5 2

出力 1

36

入力 2

7 3

出力 2

855

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.