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

建议使用的浏览器:

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

2667:SpaceStation

题目描述
N space stations are built in the space, and flights should be set among these space stations. Flights are bidirectional, and connect different space stations. A valid arrangement of flights must satisfy the rules below:
1. Every space station can be reached from all others via flights directly or indirectly.
2. Because the spaceships are too expensive, the number of flights should be minimal.
3. Due to the limited resource of service and communication, the number of flights directly connected to each space station is limited.
Here comes the problem: how many different valid arrangements can be set?
Two arrangements A and B are different means that, there exists at least one flight in A but not in B, or there exists at least one flight in B but not in A.
输入解释
The input contains multiple test cases.
The first line contains an integer T, 0 < T <= 20, representing the number of test cases.
For each test case:
The first line contains an integer N, 0 < N <= 300, representing the number of space stations. The second line contains N integers K1、K2 ? KN, 0 <= Ki <= N - 1,Ki, separated by blanks, representing the maximal flights directly connected to the i-th space station.
输出解释
For each test case:
Output one line containing an integer ? the number of arrangements in total modulo 9973.
输入样例
2 
4 
2 2 2 2 
4 
3 3 3 3 
输出样例
12 
16 
来自杭电HDUOJ的附加信息
Recommend zty

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

源链接: HDU-2667

最后修改于 2020-10-25T22:55:41+00:00 由爬虫自动更新

共提交 2

通过率 0.0%
时间上限 内存上限
6000/2000MS(Java/Others) 32768/32768K(Java/Others)