卡特兰数
2013-04-20 20:47
204 查看
卡特兰数又称卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。
卡特兰数前几项为 : 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904147324, 4861946401452, ...
卡特兰数前几项为 : 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904147324, 4861946401452, ...
#include<stdio.h> #include<string.h> #include<stdlib.h> int main() { int i,n; long h[1000]; h[0]=1; h[1]=1; for(i=2; i<20; i++) h[i]=h[i-1]*(4*i-2)/(i+1); while(~scanf("%d",&n)) { printf("%ld\n",h ); } }
相关文章推荐
- 4.3 买票找零 卡特兰数
- (资料)Catalan(卡特兰数)的算法分析与应用
- 卡特兰数
- 卡特兰数
- POJ 1095 Trees Made to Order 卡特兰数以及递归分治
- 卡特兰数
- HDU 3723卡特兰数
- acdream 1040: whxnwjq got the champion 卡特兰数
- 卡特兰数问题总结
- Catalan 卡特兰数数的分析和应用
- 卡特兰数(Catalan)
- Uva 10007 / HDU 1131 - Count the Trees (卡特兰数)
- 卡特兰数应用情景总结
- 卡特兰数(组合方法求解)
- 卡特兰数-N个结点二叉树个数
- 程序员必知(五):卡特兰数
- hdu1134(卡特兰数)
- [ACM] hdu 2067 小兔的棋盘(卡特兰数Catalan)
- hdu4165(简单递推,实则卡特兰数的应用)
- HDU 1130 How Many Trees? 卡特兰数