编程介的小学生
2019-04-19 15:18翻转数据结构的树的节点,怎么利用C语言的程序的设计的形式来实现的
Problem Description
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 li to ri.
Give you li and ri, you should output the answer.
Input
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≤n≤14). In following n line, each line has two integers li,ri(1≤li≤ri≤n).
Output
For each case output the answer modulo 109+7.
Sample Input
2
3
1 3
1 3
1 3
3
1 1
2 2
3 3
Sample Output
9
1
- 点赞
- 回答
- 收藏
- 复制链接分享
0条回答
为你推荐
- 在AJAX响应之后,翻转插件和javascript函数无法正常工作
- javascript
- ajax
- php
- jquery
- 1个回答
- PHP图像调整大小和裁剪有时翻转图像上下颠倒
- php
- gd
- 1个回答
- C语言字符串反转 argv 目前可以编译但是无法得出想要的结果?
- c语言
- 1个回答
- 数组翻转并合并多个数组
- arrays
- php
- 3个回答
- 翻硬币 ,这个是不是谈心算法,具体怎么实现呢?
- 游戏
- 2个回答
换一换