AtCoder Regular Contest 147
D
Sets Scores
AtCoder
⌀ 2145
原题
← CE →
翻译中…

Problem Statement

翻译中…

Consider a sequence of integer sets of length $N$: $S=(S_1,S_2,\dots,S_N)$. We call a sequence brilliant if it satisfies all of the following conditions:

翻译中…
  • $S_i$ is a (possibly empty) integer set, and its elements are in the range $[1,M]$. $(1 \le i \le N)$
  • The number of integers that is included in exactly one of $S_i$ and $S_{i+1}$ is $1$. $(1 \le i \le N-1)$
翻译中…

We define the score of a brilliant sequence $S$ as $\displaystyle \prod_{i=1}^{M}$ $($ the number of sets among $S_1,S_2,\dots,S_N$ that include $i$.$)$.

翻译中…

Find, modulo $998244353$, the sum of the scores of all possible brilliant sequences.

翻译中…

Constraints

翻译中…
  • $1 \le N,M \le 2 \times 10^5$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
2 3
Output #1
24
Among all possible brilliant sequences, the following $6$ have positive scores. - $S_1=\{1,2\},S_2=\{1,2,3\}$ - $S_1=\{1,3\},S_2=\{1,2,3\}$ - $S_1=\{2,3\},S_2=\{1,2,3\}$ - $S_1=\{1,2,3\},S_2=\{1,2\}$ - $S_1=\{1,2,3\},S_2=\{1,3\}$ - $S_1=\{1,2,3\},S_2=\{2,3\}$ All of them have a score of $4$, so the sum of them is $24$.
Input #2
12 34
Output #2
786334067
题目信息
题号
arc147_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。