1.

package problemSetVolumes.volume004;

import java.math.BigInteger;

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 485 - Pascal's Triangle of Death
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=426
*
* @author Siegfried Ippisch
* @version 1.0
*
* Method : -
* Status : Accepted
* Runtime: 1.232
*/
public class PascalsTriangleOfDeath {

public static void main(String[] arsg){
BigInteger max = new BigInteger("1000000000000000000000000000000000000000000000000000000000000");
System.out.println("1");
BigInteger[] line = new BigInteger[]{BigInteger.ONE,BigInteger.ONE};
print(line);

while(true){
BigInteger[] nextLine = new BigInteger[line.length+1];
nextLine[0] = BigInteger.ONE;
for(int i=1; i<line.length; i++)
nextLine[i] = line[i-1].add(line[i]);
nextLine[line.length] = BigInteger.ONE;
print(nextLine);
line = nextLine;
if(line[line.length/2].compareTo(max) > 0)
break;
}
}

public static void print(BigInteger[] array){
String s = ""+array[0];
for(int i=1; i<array.length; i++)
s+=" "+array[i];
System.out.println(s);
}

}


2.

package acm_485_pascals_triangle_of_death;

import java.math.BigInteger;
import java.util.ArrayList;

/**
* FWP, Ausgew¦hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: acm_485_pascals_triangle_of_death
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=99999999&page=show_problem&category=&problem=426
*
* @author Martin Lambeck
* @version 1.0, 18.08.2010
*
* Method : bigint
* Status : Accepted
* Runtime: 1.572
*/


public class Main
{
public static void main (String...args)
{
ArrayList<BigInteger> al = new ArrayList<BigInteger>(10);

BigInteger max = new BigInteger("1000000000000000000000000000000000000000000000000000000000000");
System.out.println("1");

al.add(BigInteger.ONE);
//al.add(BigInteger.valueOf(2));
//al.add(BigInteger.ONE);

for (int i = 0; ; i++)
{
ArrayList<BigInteger> al2 = new ArrayList<BigInteger>(10);

al2.add(BigInteger.ONE);


System.out.print("1 ");

for (int j = 1; j < al.size(); j++)
{
al2.add(al.get(j-1).add(al.get(j)));
System.out.print(al2.get(al2.size()-1) + " ");

}

System.out.println("1");

if (al2.get(al2.size() / 2).compareTo(max) > 0)
return;

al2.add(BigInteger.ONE);
al = al2;
}
}
}