hdu 1131 Count the Trees # java水大数
来源:互联网 发布:mac high sierra知乎 编辑:程序博客网 时间:2024/06/07 18:31
http://acm.hdu.edu.cn/showproblem.php?pid=1131
求N个不同结点的组成的树的种类
卡特兰数求出 树的结构 的个数,乘以结点的阶乘
import java.io.*;import java.math.*;import java.util.*;public class Main{public static void main(String []args){Scanner cin = new Scanner(System.in);Integer N = 101,i;BigInteger []cat = new BigInteger[N];BigInteger []fac = new BigInteger[N];fac[1] = cat[1] = BigInteger.valueOf(1);for(i = 2; i < N; ++i){fac[i] = fac[i-1].multiply(BigInteger.valueOf(i));cat[i] = cat[i-1].multiply(BigInteger.valueOf(i*4-2)).divide(BigInteger.valueOf(i+1));}while(cin.hasNext()){i = cin.nextInt();if(i == 0)break;System.out.println(fac[i].multiply(cat[i]));}}}
- hdu 1131 Count the Trees Java 大数
- hdu 1131 Count the Trees # java水大数
- HDU 1131Count the Trees(卡特兰数 大数)
- hdu 1131 Count the Trees (卡特兰数+java大数)
- hdu 1131 Count the Trees
- hdu 1131 Count the Trees
- hdu-1131 Count the trees
- HDU 1131 Count the trees
- hdu 1131 Count the Trees
- HDU 1131 Count the Trees
- HDU - 1131 Count the Trees
- hdu 1131 Count the Trees 卡特兰数+java
- HDOJ HDU 1131 Count the Trees
- 【HDU】1131 - Count the Trees(组合数学 - 卡特兰数 & java)
- hdu 1131 Count the Trees(catalan数的应用)
- hdu 1131 Count the Trees(n!*卡特兰数)
- HDU 1131 Count the Trees 卡特兰数的应用
- hdu 1131 Count the Trees (卡特兰数的应用)
- 用SnakeLayout实现纵向Gallery完整代码
- 请移步主博客http://blog.csdn.net/hmisty
- 一些开发心得与调试技巧
- 【实用】visual C++中最常用的类与API函数
- 利用 Heritrix 构建特定站点爬虫
- hdu 1131 Count the Trees # java水大数
- Oracle vs Google:在陪审团考虑专利问题之际法官Alsup披露自己是个程序员
- JPopupMenu_1
- hdu 1134 hdu 2067 #Java水卡特兰
- eclipse中添加jar包+出现log的问题
- javaAPI_1
- 转型操作符
- Liunx下修改MySQL字符集
- openldap配置