2153 Connected Graph
时间限制 : 2000/1000 MS(Java/Others) | 内存限制 : 60000/30000 KB(Java/Others)
提交数 : 15 | 通过数 : 8
题目描述
An undirected graph is a set V of vertices and a set of E∈{V*V} edges.An undirected graph is connected if and only if for every pair (u,v) of vertices,u is reachable from v.
You are to write a program that tries to calculate the number of different connected undirected graph with n vertices.
For example,there are 4 different connected undirected graphs with 3 vertices.

输入要求
The input contains several test cases. Each test case contains an integer n, denoting the number of vertices. You may assume that 1<=n<=50. The last test case is followed by one zero.
输出要求
For each test case output the answer on a single line.
输入样例
1
2
3
4
0
输出样例
1
1
4
38
提示
来源
pku1737
[ 返回顶端 ] | [ 代码提交 ] | [ 统计数据 ] | [ 历史提交 ]