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

建议使用的浏览器:

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

6014:Lotus and Islands

题目描述
There are $n$ islands in the world Lotus lives.Each island has a probability $p_i$ and a list consists of some other islands.
Lotus came to island 1 at first.She will repeat the following operations:
1、Assume Lotus is in island $x$,there is a probability of $ p_x $ that produces an undirected edge connecting two random islands.The two islands will not be the same, nor will they already be connected by an edge.
2、Lotus will leave contentedly if all the islands have been connected.
3、Otherwise,she will choose an random island from the current island's list and go there.Her dissatisfied value will be increased by 1.
Lotus wants you to calculate the expected value of her dissatisfied value.
The $p_i$ is given in the prime field of integers modulo $10^9+7$.You should output the answer modulo $10^9+7$,too.
输入解释
First line a integer $T(0 \leq T \leq 10)$ denoting the number of test cases.
For each test case,first line is an integer $n(1 \leq n \leq 30)$,in the second line there are $n$ integers denoting $p_i$.Each of the next $n$ lines contains an integer $x$ followed by $x$ integers describing the island's list.
It is guaranteed that for each island,its list doesn't contain two same islands,nor do itself.
输出解释
For each test case,output one line containing a single integer,denoting the answer modulo $10^9+7$.
输入样例
1
2
500000004 1
1 2
1 1
输出样例
500000004
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

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

题目来源 BestCoder Round #91

源链接: HDU-6014

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

共提交 0

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