QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 512 MB مجموع النقاط: 100 الصعوبة: [عرض]

#1816. 多重括号

الإحصائيات

考虑由括号 '(' 和 ')' 组成的字符串。 合法的括号序列是指可以通过以下规则得到的字符串:

  • 空字符串是合法的括号序列。
  • 如果 $A$ 是合法的括号序列,则 $(A)$ 也是合法的括号序列。
  • 如果 $A$ 和 $B$ 是合法的括号序列,则 $A$ 和 $B$ 的拼接也是合法的括号序列。

给定 $N$ 个编号为 $1, 2, \dots, N$ 的盒子,以及两个整数 $M$ 和 $K$。你的任务是在每个盒子中恰好放入一个合法的括号序列,使得满足以下条件:

  • 所有 $N$ 个盒子中 '(' 括号的总数等于 $M$。
  • 长度为 $2 \cdot K$ 的合法括号序列不能放入盒子中。

计算满足条件的方案数。如果存在一个编号 $i$,使得在两种方案中第 $i$ 个盒子包含的合法括号序列不同,则认为这两种方案不同。 由于答案可能非常大,请输出答案对 $998\,244\,353$ 取模的结果。

输入格式

输入包含一行,包含三个整数 $N, M, K$ ($1 \le M, N \le 10^6, 1 \le K \le M$)。

输出格式

输出答案对 $998\,244\,353$ 取模的结果。

样例

样例输入 1

2 2 1

样例输出 1

4

样例输入 2

1 1 1

样例输出 2

0

样例输入 3

24 120 30

样例输出 3

379268651

说明

对于第一个样例,以下分配方式满足条件:

  • $(())$, 空;
  • $()()$, 空;
  • 空, $(())$;
  • 空, $()()$。

因此,答案为 $4$。

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.