問題一覧 > 通常問題

No.2383 Naphthol

レベル : / AI推定難易度 : 1925 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 70
作問者 : 👑 箱星 / テスター : kaichou243
お気に入りにしたユーザー ProblemId : 8457 / 自分の提出
問題文最終更新日: 2023-06-13 22:02:27
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 397 (群論コンテスト) (順位表) の他の問題:

Problem Statement

Consider the figure formed by arranging $N$ congruent regular hexagons in a row, as shown in the following diagram.

When this figure is viewed as a graph, there are $2N+4$ vertices of degree $2$. How many ways are there to paint $K$ of these vertices red? Find the answer modulo $998244353$.

Here, colorings that coincide under rotation or reflection are considered the same.

Constraints

  • $1\le N\le 10^5$
  • $1\le K\le 2N+4$
  • All inputs are integers.

Input

$N$ $K$

Output

Output the total number of colorings modulo $998244353$.

Sample

Sample 1
Input
2 1
Output
2

There are the following $2$ ways.

Sample 2
Input
6 16
Output
1

Sample 3
Input
12345 12345
Output
423100200

Find the answer modulo $998244353$.

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