QOJ.ac

QOJ

Límite de tiempo: 3 s Límite de memoria: 512 MB Puntuación total: 100 Dificultad: [mostrar]

#1257. 简单的一题

Estadísticas

你拥有一个由数字 1 和 2 组成的序列。在一步操作中,你可以进行以下操作之一:

  1. 在所有 1 的右侧插入一个 1(如果没有 1,则可以在任何位置插入)。
  2. 如果某个 2 的右侧没有 1,则可以将该 2 变为 1。
  3. 删除最右侧的 1(注意该操作是操作 1 的逆操作)。
  4. 将最右侧的 1 变为 2(注意该操作是操作 2 的逆操作)。

例如,从序列 11212122 出发,一步操作可以得到以下序列:

  • 使用操作 1:112121122, 112121212, 112121221。
  • 使用操作 2:11212112, 11212121。
  • 使用操作 3:1121222。
  • 使用操作 4:11212222。

你的任务是计算使用恰好 $t$ 步操作,将一个恰好包含 $a$ 个数字 2 的序列变换为恰好包含 $b$ 个数字 2 的序列的方法数。

输入格式

输入仅一行,包含三个整数 $a, b, t$ ($0 \le a, b, t \le 10^6$)。

输出格式

输出将一个包含 $a$ 个数字 2 的序列变换为包含 $b$ 个数字 2 的序列,且恰好使用 $t$ 步操作的方法数。由于该数字可能非常大,请输出其对质数 $998\,244\,353$ 取模的结果。

样例

样例输入 1

0 0 4

样例输出 1

3

样例输入 2

1 4 6

样例输出 2

60

说明

在第一个样例中,你需要用 4 步操作从空序列变换为空序列。实现方法如下($\varepsilon$ 表示空序列):

$\varepsilon \to 1 \to \varepsilon \to 1 \to \varepsilon$ $\varepsilon \to 1 \to 11 \to 1 \to \varepsilon$ $\varepsilon \to 1 \to 2 \to 1 \to \varepsilon$

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.