Universal Cup Judging System

Universal Cup

Time Limit: 7.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

考虑对长度为 $n$ 的数组 $a$ 进行如下操作。选择一个下标 $i$($1 \le i < n$),然后:

  • 若 $a_i = a_{i+1}$,则将 $a_i$ 和 $a_{i+1}$ 都减去 $1$;
  • 否则,将 $a_i$ 和 $a_{i+1}$ 中较小的那个减去 $1$。

数组中的每个元素在任何时候都必须非负,因此,只有当一次操作不会使任何元素变为负数时,才能进行该操作。

如果可以通过进行任意次上述操作(也可以不进行操作)将数组 $a$ 的所有元素都变为 $0$,则称数组 $a$ 为好数组。

给定 $n$ 和 $k$。求长度为 $n$、且对每个 $i$ 都满足 $0 \le a_i \le k$ 的好数组 $a$ 的数量,对 $998\,244\,353$ 取模。

输入格式

唯一一行包含两个整数 $n$ 和 $k$($1 \le n, k \le 250\,000$)。

输出格式

输出一个整数:好数组的数量,对 $998\,244\,353$ 取模。

样例

输入格式 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.