QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 512 MB Total points: 100 Difficulty: [show]

#1257. 簡単な問題

Statistics

数字 $1$ と $2$ からなる列があります。1 回の操作で、次のいずれかを行えます。

  1. ほかのすべての $1$ より右にある位置に $1$ を挿入します($1$ がない場合は、どこに挿入してもかまいません)。
  2. ある $2$ の右側に $1$ が存在しない場合、その $2$ を $1$ に変えます。
  3. 最も右にある $1$ を削除します(この操作は操作 1 の逆であることに注意してください)。
  4. 最も右にある $1$ を $2$ に変えます(この操作は操作 2 の逆であることに注意してください)。

例えば、列 11212122 から 1 回の操作で次の列を得ることができます。

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

ちょうど $a$ 個の数字 $2$ からなる列を、ちょうど $t$ 回の操作で、ちょうど $b$ 個の数字 $2$ からなる列に変換する方法の数を求めてください。

入力

入力は 1 行のみからなり、3 つの整数 $a,b,t$($0 \le a,b,t \le 10^6$)が与えられます。

出力

$a$ 個の数字 $2$ からなる列から、ちょうど $t$ 回の操作で $b$ 個の数字 $2$ からなる列を得る方法の数を出力してください。この数は非常に大きくなることがあるので、素数 $998\,244\,353$ で割った余りを出力してください。

入出力例

入力 1

0 0 4

出力 1

3

入力 2

1 4 6

出力 2

60

注記

1 つ目の例では、空の列から 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.