1.

import java.util.BitSet;
import java.util.Scanner;

/**
* Angewandte Mathematik, SS11
* Problem: 541 - Error Correction
* Link: http://uva.onlinejudge.org/external/3/369.pdf
*
* @author Benedikt Z¨nnchen
* @author Erik Wenzel
* @version 1.0, 29/04/2011
*
* Method : Ad-hoc
* Status : Accepted
* Runtime: 0.680
*/
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);

int number;
BitSet rowBits, colBits;

while((number = sc.nextInt()) > 0)
{
rowBits = new BitSet(number);
colBits = new BitSet(number);

for(int row = 0; row<number; row++)
{
for(int col = 0; col<number; col++)
{
int bit = sc.nextInt();
if(bit==1)
{
rowBits.flip(row);
colBits.flip(col);
}
}
}
/*for(int i = 0; i<(number+number); i++)
{
System.out.println(bits.get(i));
}*/
int row=0;
int col=0;
int rowCounter=0;
int colCounter=0;
for(int i = 0; i<(number); i++)
{
if(rowBits.get(i))
{
rowCounter++;
row = i+1;
}

if(colBits.get(i))
{
colCounter++;
col = i+1;
}
}

if(rowCounter==0 && colCounter==0)
{
System.out.println("OK");
}
else if(rowCounter==1 && colCounter==1)
{
System.out.println("Change bit ("+row+","+col+")");
}
else
{
System.out.println("Corrupt");
}
}
}

}

2.

package sem2.am.errorcorrection;

/**
* Angewandte Mathematik, SS11
* Problem: 541 - Error Correction
* Link: http://uva.onlinejudge.org/external/5/541.pdf
*
* @author Florian Stein
* @author Franz Sommer
* @version 1.0, 05/01/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.580
*/

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

while (sc.hasNext()) {

// groesse der matrix auslesen
int matrixSize = sc.nextInt();

// bei 0 abbrechen
if (matrixSize == 0)
System.exit(0);

// das array fuer die matrix
int[][] matrix = new int[matrixSize][matrixSize];

// die matrix einlesen
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix.length; j++) {
matrix[i][j] = sc.nextInt();
}
}

// enthaellt evtl. die zeile/spalte, die in summe ungerade ist
int rowIsOdd = 0;
int ColIsOdd = 0;
// zaehlt wieviele ungerade zeilen es gibt.
int countOddRows = 0;
// zaehlt weiviele ungerade spalten es gibt.
int countOddCols = 0;
// tmp zum rechen
int tmp = 0;

// rechnet alle zeilensummen
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix.length; j++) {
tmp = tmp + matrix[i][j];
}
if (!((tmp % 2) == 0)) {
countOddRows++;
rowIsOdd = i+1;
}
tmp = 0;
}

// rechnet alle spaltensummen
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix.length; j++) {
tmp = tmp + matrix[j][i];
}
if (!((tmp % 2) == 0)) {
countOddCols++;
ColIsOdd = i+1;
}
tmp = 0;
}

// ausgabe
if (countOddRows > 1 || countOddCols > 1) {
System.out.println("Corrupt");
} else if (countOddRows == 1 && countOddCols == 1) {
System.out.println("Change bit (" + rowIsOdd + "," + ColIsOdd
+ ")");
} else {
System.out.println("OK");
}

}
}

}


---------------------------------------
1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 541 Error Correction
*
* @author Robert Reichart
*
* Status : Accepted
* Runtime: 0.552
*/

import java.util.*;
class Main{
public static void main(String... args){
Scanner in = new Scanner(System.in);
while (in.hasNextInt())
{
int size = in.nextInt();
if (size>0){
int[][] values = new int[size+1][size+1];

//Daten in Array einlesen
for (int i=0;i<size;i++){
for (int k=0;k<size;k++){
values[k][i] = in.nextInt();
}
}

int[] rowsum = new int[size];
int[] colsum = new int[size];
ArrayList<Integer> oddrow = new ArrayList<Integer>();
ArrayList<Integer> oddcol = new ArrayList<Integer>();

for (int i=0;i<size;i++){
int tmp=0;
for (int k=0;k<size;k++){
tmp+=values[k][i];
}
rowsum[i]=tmp;
if (tmp%2==1){oddrow.add(i+1);}
}
for (int i=0;i<size;i++){
int tmp=0;
for (int k=0;k<size;k++){
tmp+=values[i][k];
}
colsum[i]=tmp;
if (tmp%2==1){oddcol.add(i+1);}
}

if (oddrow.size() == 0 && oddcol.size() == 0) {
System.out.print("OK\n");
}
else if (oddrow.size() == 1 && oddcol.size() == 1) {
System.out.print("Change bit (" + oddrow.get(0) + "," + oddcol.get(0) + ")\n");
}
else {
System.out.print("Corrupt\n");
}

}
}
}
}