HDU 1130(卡特兰数,大数)
2014-01-14 14:40
393 查看
题意:如题。
import java.util.*; import java.math.*; public class Main{ public static void main(String[] args) { int n; Scanner in=new Scanner(System.in); BigInteger one=BigInteger.ONE; BigInteger four=new BigInteger("4"); BigInteger two=new BigInteger("2"); BigInteger st=null; BigInteger ans=null; while(in.hasNextInt()) { n=in.nextInt(); ans=BigInteger.ONE; for(int i=2;i<=n;i++) { st=new BigInteger(""+i); ans=ans.multiply(st.multiply(four).subtract(two)).divide(st.add(one)); } System.out.println(ans); } } }
相关文章推荐
- hdu 1130,hdu 1131(卡特兰数,大数)
- HDU 1130 How Many Trees?(卡特兰数+大数)
- hdu 1130 How Many Trees?(卡特兰数,大数的乘法与除法)
- hdu 1023 1130 1134 卡特兰数 (中间有大数相除和大数相乘)
- HDU 1134 卡特兰数 大数乘法除法
- hdu1134 Game of Connections 卡特兰数(大数)
- hdu 1134 卡特兰数+大数
- HDU Train Problem II (卡特兰数+大数)
- hdu 1023+1030+1134 卡特兰数+大数模板处理
- hdu 1133 卡特兰数的应用 java水大数
- hdu 1023 卡特兰数《 大数》java
- HDU 1023 Train Problem II 卡特兰数 大数的乘法除法
- HDU 1130 How Many Trees?(Catalan + 大数)
- HDU 1130 how many trees(卡特兰数)
- HDU ACM 1134 Game of Connections / 1130 How Many Trees?(卡特兰数)
- 【HDU】1130 - How Many Trees?(java - BigDecimal & 卡特兰大数打表)
- hdu 1023 大数 卡特兰数
- HDU 1130 How Many Trees? 卡特兰数
- hdu-1134-Game of Connections(卡特兰数 大数乘法除法)
- hdu 1130 How Many Trees?(卡特兰数)