【转】1-100卡特兰数(打表用)

1到100的卡特兰数,便于以后可能用到。

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

18367353072152

69533550916004

263747951750360

1002242216651368

3814986502092304

14544636039226909

55534064877048198

212336130412243110

812944042149730764

3116285494907301262

11959798385860453492

45950804324621742364

176733862787006701400

680425371729975800390

2622127042276492108820

10113918591637898134020

39044429911904443959240

150853479205085351660700

583300119592996693088040

2257117854077248073253720

8740328711533173390046320

33868773757191046886429490

131327898242169365477991900

509552245179617138054608572

1978261657756160653623774456

7684785670514316385230816156

29869166945772625950142417512

116157871455782434250553845880

451959718027953471447609509424

1759414616608818870992479875972

6852456927844873497549658464312

26700952856774851904245220912664

104088460289122304033498318812080

405944995127576985730643443367112

1583850964596120042686772779038896

6182127958584855650487080847216336

24139737743045626825711458546273312

94295850558771979787935384946380125

368479169875816659479009042713546950

1440418573150919668872489894243865350

5632681584560312734993915705849145100

22033725021956517463358552614056949950

86218923998960285726185640663701108500

337485502510215975556783793455058624700

1321422108420282270489942177190229544600

5175569924646105559418940193995065716350

20276890389709399862928998568254641025700

79463489365077377841208237632349268884500

311496878311103321137536291518809134027240

1221395654430378811828760722007962130791020

4790408930363303911328386208394864461024520

18793142726809884575211361279087545193250040

73745243611532458459690151854647329239335600

289450081175264899454283846029490767264392230

1136359577947336271931632877004667456667613940

4462290049988320482463241297506133183499654740

17526585015616776834735140517915655636396234280

68854441132780194707888052034668647142985206100

270557451039395118028642463289168566420671280440

1063353702922273835973036658043476458723103404520

4180080073556524734514695828170907458428751314320

16435314834665426797069144960762886143367590394940

64633260585762914370496637486146181462681535261000

254224158304000796523953440778841647086547372026600

1000134600800354781929399250536541864362461089950800

3935312233584004685417853572763349509774031680023800

15487357822491889407128326963778343232013931127835600

60960876535340415751462563580829648891969728907438000

239993345518077005168915776623476723006280827488229600

944973797977428207852605870454939596837230758234904050

3721443204405954385563870541379246659709506697378694300

14657929356129575437016877846657032761712954950899755100

57743358069601357782187700608042856334020731624756611000

227508830794229349661819540395688853956041682601541047340

896519947090131496687170070074100632420837521538745909320

转自http://blog.csdn.net/lttree/article/details/29392541。感谢

时间: 2024-11-05 12:25:07

【转】1-100卡特兰数(打表用)的相关文章

Buy the Ticket(卡特兰数+递推高精度)

Buy the Ticket Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1886 Accepted Submission(s): 832   Problem Description The \\\\\\\"Harry Potter and the Goblet of Fire\\\\\\\" will be on show i

catalan卡特兰数

catalan卡特兰数:卡塔兰数是组合数学中一个常出现在各种计数问题中出现的数例.由比利时的数学家欧仁·查理·卡塔兰(1814-1894)命名.卡塔兰数的一般公式为 C(2n,n)/(n+1). 一般计算式为(递归):h(n)=(4n-2)/(n+1)*h(n-1)  (n>1),h(0)=1. 计算单个catalan的C++程序: ll catalan(int n) { if(n==0||n==1) return 1; ll sum=1; for(int i=2;i<=n;i++) sum=

HDU 1134 Game of Connections(卡特兰数)

题目代号:HDU 1134 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1134 Game of Connections Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4668    Accepted Submission(s): 2729 Problem Description Thi

1023 Train Problem II(卡特兰数)

Problem Description As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the railway. Input The input contains se

卡特兰数模板

#include<stdio.h> //******************************* //打表卡特兰数 //第 n个 卡特兰数存在a[n]中,a[n][0]表示长度: //注意数是倒着存的,个位是 a[n][1] 输出时注意倒过来. //********************************* int a[105][100]; void ktl() { int i,j,yu,len; a[2][0]=1; a[2][1]=2; a[1][0]=1; a[1][1]=

NPU 2015年陕西省程序设计竞赛网络预赛(正式赛)F题 和谐的比赛(递推 ||卡特兰数(转化成01字符串))

Description 今天西工大举办了一场比赛总共有m+n人,但是有m人比较懒没带电脑,另外的n个人带了电脑.不幸的是,今天机房的电脑全坏了只能用带的电脑,一台电脑最多两人公用,确保n>=m.但是大家来的时间不同,随机次序来机房,带电脑的人直接准备比赛而没带电脑的人需要向带电脑并还没和别人公用的人求助(当然会答应).但是,如果不存在带电脑并还没和别人公用的人,那他就要等了,等是很让人头疼的,这就不和谐了,当然假如没有这样的情况发生比赛是很和谐的. Input 输入多组数据,每组数据只有一行m(

uva 1478 - Delta Wave(递推+大数+卡特兰数+组合数学)

题目链接:uva 1478 - Delta Wave 题目大意:对于每个位置来说,可以向上,水平,向下,坐标不能位负,每次上下移动最多为1, 给定n问说有多少种不同的图.结果对10100取模. 解题思路:因为最后都要落回y=0的位置,所以上升的次数和下降的次数是相同的,并且上升下降的关系满足出栈入栈的关系.即卡特兰数. 所以每次枚举i,表示有i个上升,i个下降,用组合数学枚举出位置,然后累加求和. C(2?in)?f(i)=C(2?i?2n)?f(i?1)?(n?2?i+1)?(n?2?i+2)

特殊函数卡特兰数 hdu 1134

Game of Connections Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3352    Accepted Submission(s): 1910 Problem Description This is a small but ancient game. You are supposed to write down the

HDU 1133 Buy the Ticket 卡特兰数

设50元的人为+1 100元的人为-1 满足前任意k个人的和大于等于0 卡特兰数 C(n+m, m)-C(n+m, m+1)*n!*m! import java.math.*; import java.util.*; public class Main { /** * @param args */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int cas = 1; while(tru