链接: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); } } }
时间: 2024-10-08 12:27:41