shunfurh
编程介的小学生
2019-04-19 15:18

翻转数据结构的树的节点,怎么利用C语言的程序的设计的形式来实现的

  • Golang
  • r语言
  • erlang

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条回答