Problem C: Catalan Square
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 42 Solved: 16
[Submit][Status][Web Board]
Description
Input
Output
Sample Input
0
Sample Output
1
HINT

1 import java.util.*; 2 import java.math.*; 3 4 public class Main{ 5 BigInteger[] Cal = new BigInteger[6000]; 6 void GetCal(){ 7 8 Cal[0]=BigInteger.ONE; 9 Cal[1]=BigInteger.ONE; 10 11 for(int i=2;i<=5100;i++) 12 { 13 BigInteger v1=BigInteger.valueOf(2*i*(2*i-1)); 14 BigInteger v2=BigInteger.valueOf(i*(i+1)); 15 Cal[i]=Cal[i-1].multiply(v1).divide(v2); 16 } 17 } 18 19 Main() 20 { 21 Scanner in = new Scanner(System.in); 22 int n=in.nextInt(); 23 GetCal(); 24 System.out.println(Cal[n+1]); 25 } 26 27 public static void main(String[] args) { 28 new Main(); 29 } 30 } 31 /************************************************************** 32 Problem: 1576 33 User: aking2015 34 Language: Java 35 Result: Accepted 36 Time:476 ms 37 Memory:18804 kb 38 ****************************************************************/