【卡塔兰数Catalan+Java大数BigInteger+阶乘(排列)】HDU-1131 Count the Trees

【卡塔兰数Catalan+Java大数BigInteger+阶乘(排列)】HDU-1131 Count the Trees
【卡塔兰数Catalan+Java大数BigInteger+阶乘(排列)】HDU-1131 Count the Trees

注解

1、卡塔兰数(Catalan数):令h(0)=1,h(1)=1,catalan数满足递推式。h(n)= h(0)*h(n-1)+h(1)*h(n-2) + … + h(n-1)h(0) (n>=2)。
2、Java大数BigInteger的应用。
3、此题是在hdu1130的基础上,又考虑每个节点的名称不同,相当于再加一个排列,所以是1130的结果再乘上n的阶乘,n是节点数。

结果

【卡塔兰数Catalan+Java大数BigInteger+阶乘(排列)】HDU-1131 Count the Trees