编程介的小学生 2019-01-03 20:47 采纳率: 20.5%
浏览 261
已采纳

输出节点中小于ai的变量,使用结构体怎么实现,用C语言的办法

Problem Description
Clarke is a patient with multiple personality disorder. One day, Clarke turned into a CS, did a research on data structure.
Now Clarke has n nodes, he knows the degree of each node no more than ai. He wants to know the number of ways to choose some nodes to compose to a tree of size s(1≤s≤n).

Input
The first line contains one integer T(1≤T≤10), the number of test cases.
For each test case:
The first line contains an integer n(2≤n≤50).
Then a new line follow with n numbers. The ith number ai(1≤ai<n) denotes the number that the degree of the ith node must no more than ai.

Output
For each test case, print a line with n integers. The ith number denotes the number of trees of size i modulo 109+7.

Sample Input
1
3
2 2 1

Sample Output
3 3 2

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-10-04 08:11
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

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