当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6064:RXD and numbers

题目描述
RXD has a sequence $A_1,A_2,A_3,\dots A_n$, which possesses the following properties:
- $1\leq A_i\leq m$
- $A_1 = A_n = 1$
- for all $1\leq x\leq m$, there is at least one position $p$ where $A_p = x$.
- for all $x, y$, the number of $i(1 \leq i < n)$ which satisfies $A_i = x ~ and ~ A_{i + 1} = y$ is $D_{x, y}$.
One day, naughty boy DXR clear the sequence.
RXD wants to know, how many valid sequences are there.
Output the answer module $998244353$.
$0\leq D_{i, j}<500,1\leq m\leq 400$
$n \geq 2$
输入解释
There are several test cases, please keep reading until EOF.
There are about 10 test cases, but only 1 of them satisfies $m > 50$
For each test case, the first line consists of 1 integer $m$, which means the range of the numbers in sequence.
For the next $m$ lines, in the $i$-th line, it consists of $m$ integers, the $j$-th integer means $D_{i, j}$.
We can easily conclude that $n = 1 + \sum_{i = 1}^{m}\sum_{j = 1}^{m}{D_{i, j}}$.
输出解释
For each test case, output "Case #x: y", which means the test case number and the answer.
输入样例
2
1 2
2 1
4
1 0 0 2
0 3 0 1
2 1 0 0
0 0 3 1
4
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0
输出样例
Case #1: 6
Case #2: 18
Case #3: 0
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6064

最后修改于 2020-10-25T23:27:59+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 524288/524288K(Java/Others)