1.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

/**
* Angewandte Mathematik, SS11
* Problem: 10303 - How Many Trees?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=15&page=show_problem&problem=1244
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 18/5/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.440
*/

public class Main {
public static void main(String[] args) throws Exception {
BigInteger tree[] = new BigInteger[1000];
tree[0]=BigInteger.ONE;
for (int n = 1;n<1000;n++){
tree[n] = BigInteger.valueOf(2).multiply(BigInteger.valueOf(2).multiply(BigInteger.valueOf(n)).add(BigInteger.ONE)).multiply(tree[n-1]).divide(BigInteger.valueOf(n+2));
}
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine;
while((inputLine = reader.readLine())!=null)
{
int n = new Integer(inputLine);
System.out.println(tree[n-1]);
}
}
}

--------------------------------------------------------------------------


1.
package acm_10303_how_many_trees;

import java.math.BigInteger;
import java.util.Scanner;

/**
* FWP, Ausgew¦hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: acm_10303_how_many_trees
* Link:
*
* @author Martin Lambeck
* @version 1.0, 18.08.2010
*
* Method : catalan numbers
* Status : Accepted
* Runtime: 0.240
*/


public class Main
{
static Scanner sc = new Scanner(System.in);
static BigInteger[] fak = new BigInteger[2001];

public static void main(String... args)
{
fak[0] = BigInteger.ONE;
fak[1] = BigInteger.ONE;

for (int i = 2; i < fak.length; i++)
{
fak[i] = fak[i-1].multiply(BigInteger.valueOf(i));
}

while (testcase())
;
}

public static boolean testcase()
{
if (!sc.hasNextInt())
return false;

int n = sc.nextInt();

System.out.println(trees(n));

return true;
}

static BigInteger trees (int n)
{
return fak[2*n].divide(fak[n+1].multiply(fak[n]));
}

}