1.

/**
* Angewandte Mathematik, SS11
* Problem: 10023 - Square Root
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=964
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 03/29/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 2.008
*/

import java.math.*;
import java.util.*;

//Wurzel ziehen mit Fermatfaktorisierung
public class Main {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);

BigInteger big,a,b,two;
int count;
two = BigInteger.valueOf(2);

count = input.nextInt();
for(int i = 0; i < count; i++){
big = input.nextBigInteger();
a = BigInteger.ONE.shiftLeft(big.bitLength()/2);
do{
b = big.divide(a);
a = (a.add(b)).divide(two);
}while (a.subtract(b).abs().compareTo(two) >= 0);
System.out.println(a);
if(i < count -1) System.out.println();
}
}
}

2.

package sem2.am.squareroot;

/**
* Angewandte Mathematik, SS11
* Problem: 10023 Square Root
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=964
*
* @author Sommer Franz
* @author Florian Stein
* @version 0.5, 22.05.2011
*
* Method : Heron / Newton
* Status : Wrong Answer / Time Limit Exceeded for a very big Iteration
* Runtime: 1.7 or 3+ Time limit exceeded for a very big Iteration of100000+
*/

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

class Main {

public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));

int loop = Integer.parseInt(reader.readLine());

String s = "";
for (int i = 0; i < loop; i++) {
String garbage = reader.readLine();
if (garbage == BigInteger.ZERO.toString())
break;
BigInteger readline = new BigInteger(reader.readLine());

s = s + BigSquareRoot.get(readline).toBigInteger().toString()
+ "\n\n";
}
System.out.print(s.substring(0, s.length() - 1));

}
}

--------------------------------------------------------------
1.
/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 10023 Square Root
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=12&problem=964&mosmsg=Submission+received+with+ID+7916991
*
* @author Barny Porcio
* @version 1.0, 04/22/2010
*
* Method : -
* Status : Accepted
* Runtime: 0.732
*/

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

public class Main {

public static void main(String[] args) throws NumberFormatException, IOException {

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for (int i = Integer.parseInt(br.readLine()); i > 0; --i){
br.readLine();
String val = br.readLine();
BigInteger bi = new BigInteger(val);
if (bi.equals(BigInteger.ZERO)){
System.out.println(0);
}
else{
//d ist eine grobe abschätzung der wurzel
BigInteger d;
if (val.length()%2 == 0)
d = BigInteger.TEN.pow((val.length()-2)/2).multiply(BigInteger.valueOf(6));
else
d = BigInteger.TEN.pow((val.length()-1)/2).multiply(BigInteger.valueOf(2));

//last speichert den letzten wert von d um zu sehen ab wann sich nichts mehr ändert
BigInteger last = BigInteger.ZERO;

// solange sich noch etwas ändert wird die babylonische methode erneut angewendet
for (int o = 0; true; ++o){
d = bi.divide(d).add(d).divide(BigInteger.valueOf(2));
if(last.equals(d))
break;
last = d;

}
System.out.println(d);
if (i != 1)
System.out.println();
}
}
}
}

3.

/**
* Angewandte Mathematik, SS11
* Problem: 10023 - Square root
* Link: http://uva.onlinejudge.org/external/100/10023.html
*
* @author Ritter Marius
* @author Wende Tom
* @author Zehentbauer Stefan
*
* @version 1.0, 05/17/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 2.992
* Ganz knapp -.-
*/


import java.math.BigInteger;
import java.util.Scanner;
import java.math.BigDecimal;
import java.math.*;
public class Main {

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int durchlauf = scan.nextInt();

BigInteger n;
BigInteger gtmp = BigInteger.ONE;
BigInteger g = BigInteger.ONE;
BigInteger two = BigInteger.valueOf(2);
StringBuffer out = new StringBuffer();

for(int i=0;i!=durchlauf;i++)
{
g = two;
n = scan.nextBigInteger();
if(n.compareTo(BigInteger.valueOf(1000000000))<=0)
{
out.append(String.format("\n%.0f\n",Math.sqrt(n.doubleValue())));
}
else
{
do
{
gtmp = g;
//((n/g) + g)/2
g = n.divide(gtmp).add(gtmp).shiftRight(1);
}while(g.compareTo(gtmp)!=0);
out.append("\n"+g+"\n");
}
}
System.out.print(out.deleteCharAt(0));
}

}