Universal Cup Judging System

Universal Cup

実行時間制限: 2.0 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓
統計

Misha 正在玩一个整数数组。在一次操作中,他可以执行以下任一操作:

  • 给数组的某个后缀加 1。
  • 给数组的某个前缀加 1。

例如,如果 Misha 有数组 $(1, 2, 4)$,通过一次操作,他可以得到数组 $(2, 2, 4)$、$(2, 3, 4)$、$(2, 3, 5)$、$(1, 2, 5)$ 或 $(1, 3, 5)$ 中的任意一个。

如果一个长度为 $n$ 的数组可以通过若干次操作从一个全为 $0$ 的数组得到,则称该数组是平衡的。例如,数组 $(1, 2, 1)$ 是平衡的,但数组 $(1, 3, 1)$ 不是。问有多少个长度为 $n$ 且元素最大不超过 $m$ 的数组是平衡的?答案可能非常大,请输出其对质数 $998\,244\,353$ 取模的结果。

输入格式

第一行包含两个整数 $n$ 和 $m$ ($1 \le n, m \le 500\,000$)。

输出格式

输出一个整数:长度为 $n$ 且元素最大不超过 $m$ 的平衡数组的数量。请输出答案对质数 $998\,244\,353$ 取模的结果。

样例

样例输入 1

2 2

样例输出 1

9

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#857EditorialOpen题解alpha10222026-01-28 02:27:55View

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.