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

建议使用的浏览器:

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

5103:RootedTree

题目描述
There are n nodes, you should write a program to calculate how many way to form a rooted tree. This tree must satisfy two following conditions:
1: This tree should contain all the n nodes.
2: The size of subtree whose root is node i, should be from $l_i$ to $r_i$.
Give you $l_i$ and $r_i$, you should output the answer.
输入解释
There are several cases, First is the number of cases T. (There are most ten cases).
For each case, in the first line is a integer n ($1 \leq n \leq 14$). In following n line, each line has two integers $l_i, r_i (1 \leq l_i \leq r_i \leq n$).
输出解释
For each case output the answer modulo $10^9 + 7$.
输入样例
2
3
1 3
1 3
1 3
3
1 1
2 2
3 3
输出样例
9
1
提示
The first sample: 1 -> 2 -> 3, 1 -> 3 -> 2, 2 <- 1 -> 3, 2 -> 1 -> 3, 2 -> 3 -> 1, 1 <- 2 -> 3, 
3 -> 1 -> 2, 3 -> 2 -> 1, 2 <- 3 -> 1(1 -> 2 represent 2’father is 1), these trees satisfy all the conditions.
来自杭电HDUOJ的附加信息
Recommend heyang

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

题目来源 BestCoder Round #17

源链接: HDU-5103

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

共提交 0

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