Created
April 2, 2014 15:37
-
-
Save suicide/9936610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package squaredetector; | |
/** | |
* Created by psy on 02.04.14. | |
*/ | |
public class SquareDetector { | |
private final int dimension; | |
private final char[][] field; | |
public SquareDetector(int dimension, char[][] field) { | |
this.dimension = dimension; | |
this.field = field; | |
} | |
public boolean evaluate() { | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package squaredetector; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Scanner; | |
/** | |
* Created by psy on 02.04.14. | |
*/ | |
public class SquareMain { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
List<String> output = new LinkedList<String>(); | |
int games = Integer.parseInt(in.nextLine()); | |
for (int i = 1; i <= games; i++) { | |
int dimension = in.nextInt(); | |
char[][] field = new char[dimension][dimension]; | |
in.nextLine(); | |
for (int j = 0; j < dimension; j++) { | |
field[j] = in.nextLine().toCharArray(); | |
} | |
SquareDetector detector = new SquareDetector(dimension, field); | |
boolean result = detector.evaluate(); | |
output.add("Case #" + i + ": " + (result ? "YES" : "NO")); | |
} | |
for (String out : output) { | |
System.out.println(out); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment