CF2145G.Cost of Coloring
省选/NOI-
通过率:0%
时间限制:3.00s
内存限制:512MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There is a sheet of paper divided into n rows and m columns. Initially, no cell of this sheet is colored.
In one operation, you can choose any column or row and color it (if some cells were previously colored, their color changes to the new one). During the first operation, cells are colored with color 1; during operation i>1, you can choose either color ci−1 or ci−1+1, where ci−1 is the color chosen during operation (i−1).
We call the final coloring beautiful if the following conditions are met:
- each cell is colored;
- for each color from 1 to k, there is at least one cell colored in that color, and no other colors are used in the coloring.
For a beautiful final coloring, we define its value as the minimum number of operations required to achieve it.
For each i from min(n,m) to n+m−1, calculate the number of beautiful colorings with value i. Two colorings are considered different if the color of at least one cell differs in these colorings.
有一张被划分为 n 行 m 列的纸。初始时,这张纸上没有任何格子被染色。
在一次操作中,你可以选择任意一行或一列进行染色(若某些格子此前已被染色,则它们的颜色将变为新颜色)。在第 1 次操作中,格子被染为颜色 1;在第 i 次操作(其中 i>1)中,你只能选择颜色 ci−1 或 ci−1+1,其中 ci−1 是第 (i−1) 次操作所选的颜色。
若一种最终染色满足以下条件,则称其为优美的染色:
- 每个格子均被染色;
- 对于从 1 到 k 的每种颜色,至少有一个格子被染成该颜色,且整个染色中不使用其他任何颜色。
对于一种优美的最终染色,我们将其价值定义为达成该染色所需的最少操作次数。
对每个 i(其中 i 取遍 min(n,m) 到 n+m−1 的所有整数值),计算价值为 i 的优美染色方案数。若两种染色中至少有一个格子的颜色不同,则认为这两种染色是不同的。
输入格式
The input consists of a single line containing three integers n,m,k (2≤n,m≤2000; 1≤k≤n+m−1).
输入包含一行,其中为三个整数 n,m,k(2≤n,m≤2000;1≤k≤n+m−1)。
输出格式
For each i from min(n,m) to n+m−1, output a single integer — the number of beautiful colorings with value i, taken modulo 998244353.
对于每个从 min(n,m) 到 n+m−1 的 i,输出一个整数——值为 i 的优美染色方案数对 998244353 取模的结果。
输入输出样例
输入#1
2 3 2
输出#1
2 12 6
输入#2
2 3 3
输出#2
0 18 36
输入#3
3 2 4
输出#3
0 0 36
输入#4
2 2 3
输出#4
0 8
输入#5
2 2 2
输出#5
4 4
输入#6
2 2 1
输出#6
1 0
输入#7
5 3 4
输出#7
0 90 1500 7830 8100
输入#8
3 5 3
输出#8
6 120 750 1770 930
输入#9
5 2 2
输出#9
2 15 30 35 10
输入#10
2 5 2
输出#10
2 15 30 35 10
输入解题思路,AI测评打分。不知道怎么写?