标签:http io os ar java for div 2014 on
链接:HDU 1023
/**************************************** * author : Grant Yuan * time : 2014/10/19 15:51 * source : HDU 1023 * algorithm : Catalan数+高精度 * ***************************************/ import java.io.*; import java.math.*; import java.util.*; public class Main{ public static void main(String args[]) { Scanner cin=new Scanner(System.in); BigInteger []a = new BigInteger [105]; BigInteger t; a[0]=a[1]=BigInteger.ONE; for(int i=2;i<=102;i++) { a[i]=a[i-1].multiply(BigInteger.valueOf(4*i-2)).divide(BigInteger.valueOf(i+1)); } while(cin.hasNext()){ int n=cin.nextInt(); if(n==-1) break; String str; str=a[n].toString(); System.out.println(str); } } }
标签:http io os ar java for div 2014 on
原文地址:http://blog.csdn.net/yuanchang_best/article/details/40263275