QOJ.ac

QOJ

Limite de temps : 2.0 s Limite de mémoire : 1024 MB Points totaux : 100

#9476. 012 网格

Statistiques

给定一个 $H$ 行 $W$ 列的网格。你的任务是计算为网格中的每个单元格分配一个整数的方法数,使得满足以下条件:令 $X_{h,w}$ 表示分配给从上往下第 $h$ 行、从左往右第 $w$ 列的单元格的整数:

  • 每个单元格必须恰好分配一个整数。
  • 对于所有 $1 \le h \le H$ 和 $1 \le w \le W$,满足 $X_{h,w} \in \{0, 1, 2\}$。
  • 对于所有 $1 \le h \le H - 1$ 和 $1 \le w \le W$,满足 $X_{h+1,w} - X_{h,w} \in \{0, 1\}$。
  • 对于所有 $1 \le h \le H$ 和 $1 \le w \le W - 1$,满足 $X_{h,w+1} - X_{h,w} \in \{0, 1\}$。
  • 对于所有 $1 \le h \le H - 1$ 和 $1 \le w \le W - 1$,满足 $X_{h+1,w+1} - X_{h,w} \in \{0, 1\}$。

确定满足所有这些条件的网格整数分配方案数,并将结果对 $998244353$ 取模。

输入格式

输入通过标准输入给出,格式如下:

$H \ W$

  • $1 \le H \le 2 \times 10^5$
  • $1 \le W \le 2 \times 10^5$
  • 所有输入值均为整数。

输出格式

输出一行答案。

样例

样例 1

输入

2 2

输出

11

样例 2

输入

20 23

输出

521442928

样例 3

输入

200000 200000

输出

411160917

说明

在第一个样例中,在填充网格的 11 种可能方式中,以下三种满足条件:

00
00
01
11
11
22

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.