問題一覧 > 通常問題

No.2023 Tiling is Fun

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 130
作問者 : 👑 箱星 / テスター : hahho
お気に入りにしたユーザー ProblemId : 7831 / 自分の提出
問題文最終更新日: 2022-07-16 17:13:29
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. Show the original
yukicoder contest 354 (オムニバス) (順位表) の他の問題:

Problem Statement

Consider the hexagon $ABCDEF$ on the $xy$-plane with vertices $A=(1,0),B=(a,0),C=(a,b-1),D=(a-1,b),E=(0,b),F=(0,1)$.

We tile this hexagon with the following $3$ types of shapes. Shape $1$ is a square with side length $1$, and shapes $2,3$ are parallelograms with two sides of lengths $1,\sqrt{2}$ where the angle between these two sides is $45^{\circ}$.

How many ways are there to tile the hexagon with these shapes, without rotating or reflecting them, so that there are no gaps or overlaps? Find the answer modulo $998244353$.

Constraints

  • $2\le a,b\le 10^5$
  • All inputs are integers.

Input

$a$ $b$

Output

Output the total number of tilings modulo $998244353$.

Sample

Sample 1
Input
2 3
Output
3

There are the following $3$ ways.

Sample 2
Input
31415 92653
Output
556511073

Output the answer modulo $998244353$.

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