| Task: | Ratsun reitit |
| Sender: | Anniiiz |
| Submission time: | 2020-09-29 14:32:21 +0300 |
| Language: | Python3 (CPython3) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | RUNTIME ERROR | 0 |
| #2 | RUNTIME ERROR | 0 |
| #3 | RUNTIME ERROR | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #2 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #3 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #4 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #5 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #6 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #7 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #8 | RUNTIME ERROR | 0.02 s | 2, 3 | details |
| #9 | RUNTIME ERROR | 0.02 s | 2, 3 | details |
| #10 | RUNTIME ERROR | 0.02 s | 2, 3 | details |
| #11 | RUNTIME ERROR | 0.02 s | 3 | details |
| #12 | RUNTIME ERROR | 0.02 s | 3 | details |
| #13 | RUNTIME ERROR | 0.02 s | 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: RUNTIME ERROR
| input |
|---|
| 4 |
| correct output |
|---|
| 0 3 2 5 3 4 1 2 2 1 4 3 5 2 3 2 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 2
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| 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 |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 3
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| 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 |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 4
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| 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 |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 5
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| 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 |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 6
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| 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 |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 7
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| 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) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 8
Group: 2, 3
Verdict: RUNTIME ERROR
| input |
|---|
| 25 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 9
Group: 2, 3
Verdict: RUNTIME ERROR
| input |
|---|
| 49 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 10
Group: 2, 3
Verdict: RUNTIME ERROR
| input |
|---|
| 50 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 11
Group: 3
Verdict: RUNTIME ERROR
| input |
|---|
| 75 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 12
Group: 3
Verdict: RUNTIME ERROR
| input |
|---|
| 99 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...Test 13
Group: 3
Verdict: RUNTIME ERROR
| input |
|---|
| 100 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 47, in <module>
main()...