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

建议使用的浏览器:

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

6361:Lost In The Echo

题目描述
Charles enjoys learning. He often goes to the website Wikipedia to study computer science. Just now Charles seriously studied a series of expressions, in which algebraic expression has a great influence on him.

He is curious about how many different algebraic expressions built up from $n$ distinct variables, elementary arithmetic operations (i.e. addition, subtraction, multiplication and division), and brackets such that each variable appears exactly once and each operation is after a variable or a pair of brackets. Can you help him calculate the answer in modulo $(10^9 + 7)$?

Two algebraic expressions in this problem are considered as equivalent if and only if they can be simplified as the same rational expression. For example, assuming $a$, $b$, $c$ and $d$ are variables, $(a - d) / (b - c)$ is equivalent to $(d - a) / (c - b)$, $a / (b - c) * d$ is equivalent to $a / ((b - c) / d)$ but $a / b + c / d$ is not equivalent to $d / c + b / a$.
输入解释
The first line contains one integer $T$, indicating the number of test cases.
Each of the following $T$ lines describes a test case and contains only one integer $n$.
$1 \leq T, n \leq 60000$.
输出解释
For each test case, output the answer modulo $(10^9 + 7)$ in one line.
输入样例
6
1
2
3
4
5
6
输出样例
1
6
68
1170
27142
793002
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6361

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

共提交 0

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