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

建议使用的浏览器:

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

5896:Running King

题目描述
In People's Republic Of Running, people are crazy about runnning. They keep a habit of running everyday, especially the Head King, because he isn't confident about his figure (please don't tell him~).

The Head King is going to build a new city, which contains $N$ towns. He want to build some bidirectional roads between some of the towns (each road connect two towns) and choose some of them to form his private running route. The Head King can't accept more than one bidirectional roads between two towns, because he has no sense of direction and it will make him bemused. He prefers enjoying the landscape changing while running, so he can't stand any same road on his running route.

Now, the Head King wants to know the total number of scheme of road constructing. Every scheme satisfies that there exist a town for him both to start and finish running(the running route contains at least one road). Please note the towns in the city needn't to be connected to each other.
输入解释
First line contains $T(T \leq 10)$, the number of test cases.

For each case, there is one single line containing one non-negative integer $N(n \leq 2e5)$.

It is guarantee that there are at most one case in which $n \geq 1000$
输出解释
For each test case, output a single number —— the number of schemes modulo the population of King's country($1004535809$).
输入样例
3
2
3
4
输出样例
0
1
26
提示
In sample 1, the Head King can't design any scheme. 
In sample 2, the Head King can build three roads:1-2, 2-3, 3-1, and he can start from town 1 (2 and 3 are also legal) and run along the route:1-2-3-1 (or 1-3-2-1).
In sample 3, one possible scheme is building 3 roads:1-3, 3-4, 4-1, and the Head King can start from town 3 and run along the route:3-1-4-3.
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5896

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

共提交 0

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