| Task: | Ratsun reitit |
| Sender: | Zendium |
| Submission time: | 2020-10-02 14:46:27 +0300 |
| Language: | Java |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.21 s | 1, 2, 3 | details |
| #2 | ACCEPTED | 0.22 s | 1, 2, 3 | details |
| #3 | ACCEPTED | 0.24 s | 1, 2, 3 | details |
| #4 | ACCEPTED | 0.29 s | 1, 2, 3 | details |
| #5 | ACCEPTED | 0.41 s | 1, 2, 3 | details |
| #6 | ACCEPTED | 0.56 s | 1, 2, 3 | details |
| #7 | TIME LIMIT EXCEEDED | -- | 1, 2, 3 | details |
| #8 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
| #9 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
| #10 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
| #11 | TIME LIMIT EXCEEDED | -- | 3 | details |
| #12 | TIME LIMIT EXCEEDED | -- | 3 | details |
| #13 | TIME LIMIT EXCEEDED | -- | 3 | details |
Compiler report
Note: input/RatsuDataT.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
Code
import java.util.ArrayList;
import java.util.Scanner;
public class RatsuDataT {
static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
int rowColumn = Integer.parseInt(scanner.nextLine());
ArrayList<ArrayList> yList = new ArrayList<>(rowColumn);
// List Fill
for (int ii = 0; ii < rowColumn; ii++) {
ArrayList<Integer> xList = new ArrayList<>(rowColumn);
for (int iii = 0; iii < rowColumn; iii++) {
xList.add(0);
}
yList.add(xList);
}
// Integer comb
ArrayList<Integer> thisPointsX = new ArrayList<>();
thisPointsX.add(0);
ArrayList<Integer> thisPointsY = new ArrayList<>();
thisPointsY.add(0);
ArrayList<Integer> nextPointsX = new ArrayList<>();
ArrayList<Integer> nextPointsY = new ArrayList<>();
ArrayList<Integer> roskisX = new ArrayList<>();
ArrayList<Integer> roskisY = new ArrayList<>();
int steps = 0;
int testi = 0;
boolean contin = true;
while (contin) {
for (int thisPointX = 0; thisPointX < thisPointsX.size(); thisPointX++) {
int ycoord = 0;
for (ArrayList<Integer> y : yList) {
for (int x = 0; x < y.size(); x++) {
boolean trash = false;
for (int i = 0; i < roskisX.size(); i++){
if(roskisX.get(i) == x && roskisY.get(i) == ycoord){
trash = true;
}
}
if ((((x == thisPointsX.get(thisPointX) + 2 || x == thisPointsX.get(thisPointX) - 2)
&& (ycoord == thisPointsY.get(thisPointX) + 1 || ycoord == thisPointsY.get(thisPointX) - 1))
||
((x == thisPointsX.get(thisPointX) + 1 || x == thisPointsX.get(thisPointX) - 1)
&& (ycoord == thisPointsY.get(thisPointX) + 2 || ycoord == thisPointsY.get(thisPointX) - 2)))
&& !trash
) {
nextPointsX.add(x);
nextPointsY.add(ycoord);
y.set(x, steps + 1);
}
/*
if (y.indexOf(x) == thisPointsX.get(thisPointX) + 2 && yList.indexOf(y) == thisPointsY.get(thisPointX)){
nextPointsX.add(y.indexOf(x));
nextPointsY.add(yList.indexOf(y));
x = steps;
System.out.println("X: " + y.indexOf(x) + ", Y: " + yList.indexOf(y) + "paint");
}
*/
}
ycoord++;
}
}
// juna
roskisX.addAll(thisPointsX);
roskisY.addAll(thisPointsY);
thisPointsX.clear();
thisPointsY.clear();
thisPointsX.addAll(nextPointsX);
thisPointsY.addAll(nextPointsY);
nextPointsX.clear();
nextPointsY.clear();
steps++;
//yList.get(1).set(0, 3);
//yList.get(1).set(1, 4);
//yList.get(0).set(1, 3);
//yList.get(2).set(2, 4);
//yList.get(4).set(4, 4);
if (steps == rowColumn){ contin = false; }
/*
int timesY = 0;
w:
for (ArrayList<Integer> y: yList){
int timesX = 0;
for (int x: y){
if (x == 0 && !(timesX == 0 && timesY == 0)){
contin = true;
break w;
} else {
contin = false;
}
timesX++;
}
timesY++;
}
*/
}
String lol = "";
for (ArrayList<Integer> y: yList){
for (int x: y){
lol += (x + " ");
}
lol += ("\n");
}
System.out.print(lol);
}
}Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 4 |
| correct output |
|---|
| 0 3 2 5 3 4 1 2 2 1 4 3 5 2 3 2 |
| user output |
|---|
| 0 3 2 0 3 4 1 2 2 1 4 3 0 2 3 2 |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 5 |
| correct output |
|---|
| 0 3 2 3 2 3 4 1 2 3 2 1 4 3 2 3 2 3 2 3 2 3 2 3 4 |
| user output |
|---|
| 0 3 2 3 2 3 4 1 2 3 2 1 4 3 2 3 2 3 2 3 2 3 2 3 4 |
Test 3
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 6 |
| correct output |
|---|
| 0 3 2 3 2 3 3 4 1 2 3 4 2 1 4 3 2 3 3 2 3 2 3 4 2 3 2 3 4 3 ... |
| user output |
|---|
| 0 3 2 3 2 3 3 4 1 2 3 4 2 1 4 3 2 3 3 2 3 2 3 4 2 3 2 3 4 3 ... |
Test 4
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 7 |
| correct output |
|---|
| 0 3 2 3 2 3 4 3 4 1 2 3 4 3 2 1 4 3 2 3 4 3 2 3 2 3 4 3 2 3 2 3 4 3 4 ... |
| user output |
|---|
| 0 3 2 3 2 3 4 3 4 1 2 3 4 3 2 1 4 3 2 3 4 3 2 3 2 3 4 3 2 3 2 3 4 3 4 ... Truncated |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 8 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 3 4 1 2 3 4 3 4 2 1 4 3 2 3 4 5 3 2 3 2 3 4 3 4 2 3 2 3 4 3 4 5 ... |
| user output |
|---|
| 0 3 2 3 2 3 4 5 3 4 1 2 3 4 3 4 2 1 4 3 2 3 4 5 3 2 3 2 3 4 3 4 2 3 2 3 4 3 4 5 ... Truncated |
Test 6
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 9 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 3 4 1 2 3 4 3 4 5 2 1 4 3 2 3 4 5 4 3 2 3 2 3 4 3 4 5 2 3 2 3 4 3 4 5 4 ... |
| user output |
|---|
| 0 3 2 3 2 3 4 5 4 3 4 1 2 3 4 3 4 5 2 1 4 3 2 3 4 5 4 3 2 3 2 3 4 3 4 5 2 3 2 3 4 3 4 ... Truncated |
Test 7
Group: 1, 2, 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 10 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 3 4 1 2 3 4 3 4 5 6 2 1 4 3 2 3 4 5 4 5 3 2 3 2 3 4 3 4 5 6 2 3 2 3 4 3 4 5 4 5 ... |
| user output |
|---|
| (empty) |
Test 8
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 25 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 9
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 49 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 10
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 50 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 11
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 75 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 12
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 99 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 13
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
