编程介的小学生 2019-04-19 15:18 采纳率: 20.5%
浏览 132

翻转数据结构的树的节点,怎么利用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条回答

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器