mirror of
https://github.com/Xevion/contest.git
synced 2025-12-15 20:11:23 -06:00
problem 10 11 12
This commit is contained in:
6
uil/october-2013/12/.classpath
Normal file
6
uil/october-2013/12/.classpath
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
uil/october-2013/12/.project
Normal file
17
uil/october-2013/12/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<projectDescription>
|
||||
<name>12</name>
|
||||
<comment/>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
7
uil/october-2013/12/.settings/org.eclipse.jdt.core.prefs
Normal file
7
uil/october-2013/12/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
11
uil/october-2013/12/.vscode/launch.json
vendored
Normal file
11
uil/october-2013/12/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "CodeLens (Launch) - problem12",
|
||||
"request": "launch",
|
||||
"mainClass": "problem12",
|
||||
"projectName": "12"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
uil/october-2013/12/bin/CheckerBoard.class
Normal file
BIN
uil/october-2013/12/bin/CheckerBoard.class
Normal file
Binary file not shown.
BIN
uil/october-2013/12/bin/Point.class
Normal file
BIN
uil/october-2013/12/bin/Point.class
Normal file
Binary file not shown.
BIN
uil/october-2013/12/bin/problem12.class
Normal file
BIN
uil/october-2013/12/bin/problem12.class
Normal file
Binary file not shown.
9
uil/october-2013/12/input.dat
Normal file
9
uil/october-2013/12/input.dat
Normal file
@@ -0,0 +1,9 @@
|
||||
1
|
||||
B B
|
||||
B B B
|
||||
B B B
|
||||
B B
|
||||
B B R
|
||||
R R R R
|
||||
R R R R
|
||||
R R R
|
||||
52
uil/october-2013/12/src/problem12.java
Normal file
52
uil/october-2013/12/src/problem12.java
Normal file
@@ -0,0 +1,52 @@
|
||||
import static java.lang.System.*;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Scanner;
|
||||
|
||||
class Point {
|
||||
int x;
|
||||
int y;
|
||||
Point(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
|
||||
class CheckerBoard {
|
||||
Point[] offsets = {Point(1, 1), Point(-1, -1), Point(-1, 1), Point(1, -1)};
|
||||
|
||||
CheckerBoard(String[][] matrix) {
|
||||
|
||||
}
|
||||
|
||||
int[][] getPossible(int x, int y) {
|
||||
return getPossible(x, y, new int[0][0]);
|
||||
}
|
||||
int[][] getPossible(int x, int y, List<Point> blacklist) {}
|
||||
}
|
||||
|
||||
class problem12 {
|
||||
public static void main(String[] args) throws FileNotFoundException {
|
||||
// Constants
|
||||
File input = new File("input.dat");
|
||||
Scanner read = new Scanner(input);
|
||||
int lines = Integer.parseInt(read.nextLine());
|
||||
|
||||
// Start reading and processing the matrix into
|
||||
for(int i = 0; i < lines; i++) {
|
||||
String[][] rawMatrix = new String[8][8];
|
||||
for(int x = 0; x < 8; x++) {
|
||||
String line = read.nextLine();
|
||||
for(int y = 0; y < 8; y++)
|
||||
rawMatrix[x][y] = line.substring(y, y+1);
|
||||
}
|
||||
|
||||
out.println(Arrays.deepToString(rawMatrix));
|
||||
CheckerBoard cb = new CheckerBoard(rawMatrix);
|
||||
out.println(cb.scan());
|
||||
}
|
||||
|
||||
read.close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user