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

建议使用的浏览器:

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

7021:Guess Or Not 2

题目描述
Bob has a generator which can generate a discrete probability distribution according to a given vector and a parameter.

This generator can be described as follows:



Now, given a vector $y[1..k]$, compute the probability density of the discrete probability distribution $y'[1..k]$ the algorithm output at the given vector $y[1..k]$. More specificly, compute the probability density $f_{GENERATE(x,k,t)}(y)$. Here, we see $GENERATE(x,k,t)$ as a random vector.

You should print the answers module $998244353$.
输入解释
The first line contains the only integer $T$ denoting the number of test cases.

Each of the following $T$ test cases begins with two integers $k$ and $t$ in the first line, $k$ intergers $x_i$ follow in the second line and $k$ intergers $z_i$ follow in the third line.

Here, you can compute $y_i$ by $y_i = z_i / \sum_{j} z_j$.

Note that $\sum k \le 10^6, k \in [2,10^6], t, x_i, z_i \in [1,998244353)$.
输出解释
For each test case, print the only integer in one line denoting the required probability density module $998244353$.

Note that we guarantee the answers always exsit, i.e., $\sum z_i$ $mod$ $998244353$ $\ne 0$.
输入样例
2
3 1
1 1 1
2 2 2
3 2
1 1 1
1 2 3
输出样例
2
596788047

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

源链接: HDU-7021

最后修改于 2021-10-23T19:11:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)