2.6题目翻译

题目链接:https://acs.jxnu.edu.cn/problem/HDU1294

Give you two definitions tree and rooted tree. An undirected connected graph without cycles is called a tree. A tree is called rooted if it has a distinguished vertex r called the root. Your task is to make a program to calculate the number of rooted trees with n vertices denoted as Tn. The case n=5 is shown in Fig. 1.

输入:

There are multiple cases in this problem and ended by the EOF. In each case, there is only one integer means n(1<=n<=40) .

输出:

For each test case, there is only one integer means Tn.

给出树和有根的树两个定义。一个没有圆圈的无向连通的图被称为树。如果树有一个称为根的显著顶点r,则称为有根的树。你的任务是设计一个程序来计算用n个顶点的为Tn的有根的树的数量。情况n=5如图1所示。

在这个问题中有多个情况,并以EOF结束。在每种情况下,只有一个整数表示n(1<=n<=40)。

对于每个测试用例,只有一个整数表示Tn。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值