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

建议使用的浏览器:

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

5279:YJC plays Minecraft

题目描述
YJC is an old driver of mini train. Today when he was playing his favorite game Minecraft, he found $n$ islands. YJC numbered them $1$...$n$, and on the $i$th island, there are ${a}_{i}$ cities. Every two cities on the same island are connected directly by a road. Also, the ${a}_{i}$th city on the $i$th island and the $1$th city on the $i+1$th island are connected by an underwater railway. ($1\leq i< n$) Specially, the ${a}_{n}$th city on the $n$th island and the $1$th city on the $1$th island are connected by an underwater railway.

YJC decides to pull down some of the roads and railways, making every two cities connected directly or indirectly by at most one unique route or not connected at all. Now YJC wants to know how many ways there are to reach his goal. The answer can be huge, so output the answer modulo $998244353$.
输入解释
Multiple tests.

The first line one integer T, indicating the number of cases.

For each test:

The first line one integer $n$, indicating the number of islands.

Next $n$ lines, in each line there is one integer ${a}_{i}$.

$1\leq T\leq 5,n\leq 100000,1\leq {a}_{i}\leq 100000$
输出解释
For each test:

One line, one integer, the answer modulo $998244353$.
输入样例
1
3
3
3
3
输出样例
2680
来自杭电HDUOJ的附加信息
Recommend hujie

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

题目来源 BestCoder Round #46

源链接: HDU-5279

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

共提交 0

通过率 --%
时间上限 内存上限
16000/8000MS(Java/Others) 524288/262144K(Java/Others)