Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:预先把各个节点所能形成的树的个数放到一个数组里

Posted by vidivici at 2007-11-02 19:11:40 on Problem 1095
In Reply To:预先把各个节点所能形成的树的个数放到一个数组里 Posted by:yogafrank at 2007-07-30 10:01:55
> long c[19]={1,1,2,5,14,42,132,429,1430,4862,16796,58786,208012,742900,2674440,9694845,35357670,129644790,477638700};
> 
> 这是怎么计算的呢?
#include<iostream.h>
int main()
{long int num[19];
 for(int j=0;j<19;j++)
  num[j]=0;
 num[0]=1;
 for(int j=1;j<19;j++)
 for(int i=0;i<j;i++)
 num[j]+=num[i]*num[j-1-i];
 
 for(int j=0;j<19;j++)
  cout<<num[j]<<endl;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator