Task: | Ratsun reitit |
Sender: | pinger80 |
Submission time: | 2020-10-11 09:39:52 +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.03 s | 1, 2, 3 | details |
#4 | RUNTIME ERROR | 0.03 s | 1, 2, 3 | details |
#5 | RUNTIME ERROR | 0.03 s | 1, 2, 3 | details |
#6 | RUNTIME ERROR | 0.03 s | 1, 2, 3 | details |
#7 | RUNTIME ERROR | 0.04 s | 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 |
Code
n = int(input()) d = {} dx = [1,2,-1,-2,1,2,-1,-2] dy = [2,1,2,1,-2,-1,-2,-1] for y in range(n): for x in range(n): for z in range(8): if x+dx[z] >= 0 and y+dy[z] >= 0 and x+dx[z] < n and y+dy[z] < n: if str(x)+","+str(y) in d: d[str(x)+","+str(y)].append(str(x+dx[z])+","+str(y+dy[z])) else: d[str(x)+","+str(y)] = [str(x+dx[z])+","+str(y+dy[z])] def bfs(graph, start, goal): visited = [] queue = [[start]] if start == goal: return 0 while queue: path = queue.pop(0) node = path[-1] if node not in visited: neighbours = graph[node] for neighbour in neighbours: new_path = list(path) new_path.append(neighbour) queue.append(new_path) if neighbour == goal: return len(new_path)-1 visited.append(node) for y in range(n): for x in range(n): bfs(d, "0,0", str(x)+","+str(y)) for x in taulukko: print(*x, sep=" ")
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 41, in <module> for x...
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 41, in <module> for x...
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 41, in <module> for x...
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 41, in <module> for x...
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 41, in <module> for x...
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 41, in <module> for x...
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 41, in <module> for x...
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) |