AT_arc230_d.Min Max Matrix
省选/NOI-
通过率:0%
时间限制:4.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given positive integers H, W, and M.
Find the number, modulo 998244353, of H×W matrices A, each of whose elements is an integer between 1 and M (inclusive), satisfying the following condition.
\[ \min_{1\le i\le H}\max_{1\le j\le W}A_{i,j}=\max_{1\le j\le W}\min_{1\le i\le H}A_{i,j} \]
Here, Ai,j denotes the element at the i-th row and j-th column of matrix A.
给定正整数 H、W 和 M。
求满足以下条件的 H×W 矩阵 A 的个数(对 998244353 取模),其中矩阵 A 的每个元素均为 1 到 M(含端点)之间的整数:
[
\min_{1\le i\le H}\max_{1\le j\le W}A_{i,j}=\max_{1\le j\le W}\min_{1\le i\le H}A_{i,j}
]
其中,Ai,j 表示矩阵 A 中第 i 行、第 j 列的元素。
输入格式
The input is given from Standard Input in the following format:
H W M
输入从标准输入中以如下格式给出:
H W M
输出格式
Output the answer.
输出答案。
输入输出样例
输入#1
2 2 3
输出#1
67
输入#2
99 82 44353
输出#2
213254234
说明/提示
Sample 1 Explanation:
For example, A=(1223) satisfies the condition.
- 1≤i≤Hmin1≤j≤WmaxAi,j=1≤j≤Wmax1≤i≤HminAi,j=2 holds.
On the other hand, A=(1332) does not satisfy the condition.
- 1≤i≤Hmin1≤j≤WmaxAi,j=3,1≤j≤Wmax1≤i≤HminAi,j=2.
There are 67 matrices A satisfying the condition.
Constraints
- 1≤H,W≤200
- 1≤M≤108
- All input values are integers.
样例 1 解释:
例如,矩阵 A=(1223) 满足条件。
- 1≤i≤Hmin1≤j≤WmaxAi,j=1≤j≤Wmax1≤i≤HminAi,j=2 成立。
而矩阵 A=(1332) 不满足条件。
- 1≤i≤Hmin1≤j≤WmaxAi,j=3,1≤j≤Wmax1≤i≤HminAi,j=2。
共有 67 个满足条件的矩阵 A。
限制条件
- 1≤H,W≤200
- 1≤M≤108
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?