問題一覧 > 通常問題

No.2033 Chromatic Duel

レベル : / AI推定難易度 : 2050 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 35
作問者 : Shirotsume / テスター : ygussany とりゐ
お気に入りにしたユーザー ProblemId : 8218 / 自分の提出
問題文最終更新日: 2022-08-09 12:44:06
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 355 (順位表) の他の問題:

Problem Statement

There is a board with $N$ squares arranged in a horizontal row. Initially, nothing is placed on any square.

The first player and the second player perform the following operations on this board.

  1. The first player chooses $B$ distinct squares out of the $N$ squares and places $1$ black piece on each of them.
  2. The second player places white pieces on the board according to the rules below.
    • The number of pieces placed on $1$ square, counting white and black pieces together, is at most $1$.
    • White pieces must not be placed on a square horizontally adjacent to a square containing a black piece. Pieces of the same color may be adjacent to each other.

The maximum possible number of white pieces the second player can place depends on how the first player places the pieces.

There are $\dbinom{N}{B}$ ways for the first player to place the black pieces. Among them, how many are such that the maximum possible number of white pieces the second player can place is exactly $W$? Find this count modulo $998244353$.

Constraints

  • All input values are integers.
  • $3 \leq N \leq 2 \times 10^5$
  • $1 \leq B$
  • $0 \leq W$
  • $B + W \leq N$

Input

The input is given from standard input in the following format.

$N$ $B$ $W$

Output

Print the answer, followed by a newline.

Sample

Sample 1
Input
4 1 1
Output
2

The $2$ ways are shown below. For each of them, the state of the board after both players' operations is shown. A square with a black piece is represented by x, and an empty square by ..

  • .x..
  • ..x.

If the first player chooses the arrangement x..., the second player can place $2$ white pieces as in x.oo, which violates the condition of the problem.

Sample 2
Input
6 2 1
Output
6

The $6$ ways are shown below.

  • x..x..
  • .x.x..
  • x...x.
  • ..x.x.
  • .x...x
  • ..x..x
Sample 3
Input
5 3 0
Output
8

The $8$ ways are shown below.

  • xx.x.
  • xx..x
  • x.xx.
  • x.x.x
  • x..xx
  • .xxx.
  • .xx.x
  • .x.xx
Sample 4
Input
200000 123456 67890
Output
400954588

Print the answer modulo $998244353$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。