Task: | Ratsun reitit |
Sender: | Anniiiz |
Submission time: | 2020-09-29 14:25:31 +0300 |
Language: | Python3 (CPython3) |
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.03 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.03 s | 1, 2, 3 | details |
#3 | WRONG ANSWER | 0.03 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.03 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.03 s | 1, 2, 3 | details |
#6 | WRONG ANSWER | 0.04 s | 1, 2, 3 | details |
#7 | WRONG ANSWER | 0.05 s | 1, 2, 3 | details |
#8 | WRONG ANSWER | 0.81 s | 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 |
Code
class paikka: def __init__(self, x = 0, y = 0, matka = 0): self.x = x self.y = y self.matka = matka def on_laudalla(x, y, n): if x >= 1 and x <= n and y >= 1 and y <= n: return True return False def minimi_maaliin(heppa, maali, n): x_vaihtoehto = [2, 2, -2, -2, 1, 1, -1, -1] y_vaihtoehto = [1, -1, 1, -1, 2, -2, 2, -2] jono = [] jono.append(paikka(heppa[0], heppa[1], 0)) kayty = [[False for i in range(n+1)] for j in range(n+1)] kayty[heppa[0]] [heppa[1]] = True while len(jono) > 0: a = jono[0] jono.pop(0) if(a.x == maali[0] and a.y == maali[1]): return a.matka for i in range(8): x = a.x + x_vaihtoehto[i] y = a.y + y_vaihtoehto[i] if(on_laudalla(x, y, n) and not kayty[x][y]): kayty[x][y] = True jono.append(paikka(x, y, a.matka + 1)) def main(): n = int(input()) heppa = [1, 1] for i in range(1, n+1): for j in range(1, n+1): maali = [i, j] print(minimi_maaliin(heppa, maali, n), end = "") print("") main()
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 |
---|
0325 3412 2143 5232 |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
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 |
---|
03232 34123 21432 32323 23234 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
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 |
---|
032323 341234 214323 323234 232343 ... |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
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 |
---|
0323234 3412343 2143234 3232343 2323434 ... |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
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 |
---|
03232345 34123434 21432345 32323434 23234345 ... |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
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 |
---|
032323454 341234345 214323454 323234345 232343454 ... |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
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 |
---|
0323234545 3412343456 2143234545 3232343456 2323434545 ... Truncated |
Test 8
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
25 |
correct output |
---|
0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
user output |
---|
032323454567678989101110111213... Truncated |
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) |