問題一覧 > 通常問題

No.2932 Eh, eh, no way no way no way, wait wait wait??? Huh, seriously? For real? This is seriously way too crazy, you know? Eh, oh, is it really okay to do this much DP??? This is seriously way too crazy, you know???

レベル : / AI推定難易度 : 1100 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 50
作問者 : tnodino / テスター : hirayuu_yc 👑 loop0919 mymelochan kusirakusira amesyu nouka28 uruzunyaa
お気に入りにしたユーザー ProblemId : 11238 / 自分の提出
問題文最終更新日: 2024-10-12 07:28:46
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
第3回緑以下コンテスト エキストラ (順位表) の他の問題:

Problem Statement

There is a grid $A$ with $H$ rows and $W$ columns. The cell in the $i$-th row from the top and the $j$-th column from the left contains an integer $A_{(i, j)}$.

Let the function $f(A)$ be the answer to the following problem.

You start at cell $(1, 1)$, and repeatedly move from your current cell to the adjacent cell on the right $(i, j+1)$ or the adjacent cell below $(i+1, j)$.

However, you cannot make a move that goes outside the grid.

Furthermore, letting $x$ be the value written in the current cell and $y$ be the value written in the destination cell, $x \lt y$ must hold.

How many ways are there to move to cell $(H, W)$?

Here, $2$ ways of moving $(P_1 \dots P_N)$ and $(Q_1 \dots Q_M)$ are considered different if $N \neq M$, or if there exists at least $1$ index $i$ such that $P_i \neq Q_i$.

($P_i, Q_i$ denote a move to the right or down.)

There are $M^{HW}$ grids with $H$ rows and $W$ columns in which each cell contains an integer satisfying $1 \le A_{(i, j)} \le M$.

Output the sum of the values of $f(A)$ over all these grids, modulo $998244353$.

Constraints

  • $2 \le H, W \le 2,000$
  • $1 \le M \le 10^9$
  • All inputs are integers

Input

$H\ W\ M$

Output

Output the answer.

Sample

Sample 1
Input
2 2 3
Output
6

There are 4 grids with $f(A) = 1$.
12 12 11 13
13 33 23 23

There is 1 grid with $f(A) = 2$.
12
23

All other grids have $f(A) = 0$.
The sum of $f(A)$ over all grids is 6.

Sample 2
Input
2 2 2
Output
0

In no grid is it possible to move to $(H, W)$.

Sample 3
Input
1000 1000 100000
Output
866431467

Output the answer modulo $998244353$.

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