| Task: | Monikulmio |
| Sender: | paulajantunen |
| Submission time: | 2025-11-08 22:18:56 +0200 |
| Language: | Python3 (CPython3) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | RUNTIME ERROR | 0 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | RUNTIME ERROR | 0.02 s | 0 | details |
| #2 | RUNTIME ERROR | 0.02 s | 0 | details |
| #3 | RUNTIME ERROR | 0.02 s | 0 | details |
| #4 | RUNTIME ERROR | 0.02 s | 0 | details |
| #5 | RUNTIME ERROR | 0.02 s | 0 | details |
| #6 | RUNTIME ERROR | 0.02 s | 0 | details |
| #7 | RUNTIME ERROR | 0.02 s | 0 | details |
| #8 | RUNTIME ERROR | 0.02 s | 0 | details |
| #9 | RUNTIME ERROR | 0.02 s | 0 | details |
| #10 | RUNTIME ERROR | 0.02 s | 0 | details |
Code
from collections import deque
n, m, k = map(int, input().split())
pts = [tuple(map(int, input().split())) for _ in range(n)]
grid = [['0'] * m for _ in range(n)]
def draw_line(y1, x1, y2, x2):
dy = y2 - y1
dx = x2 - x1
sy = 1 if dy > 0 else -1 if dy < 0 else 0
sx = 1 if dx > 0 else -1 if dx < 0 else 0
y, x = y1, x1
grid[y][x] = '*'
while (y, x) != (y2, x2):
y += sy
x += sx
if (y, x) == (y2, x2):
break
if sy == 0:
grid[y][x] = '='
elif sx == 0:
grid[y][x] = '|'
elif sy == sx:
grid[y][x] = '\\'
else:
grid[y][x] = '/'
for i in range(k):
y1, x1 = pts[i]
y2, x2 = pts[(i + 1) % k]
draw_line(y1, x1, y2, x2)
for y, x in pts:
grid[y][x] = '*'
vis = [[False] * m for _ in range(n)]
dq = deque()
for i in range(n):
dq.append((i, 0))
dq.append((i, m - 1))
for j in range(m):
dq.append((0, j))
dq.append((n - 1, j))
while dq:
y, x = dq.popleft()
if not (0 <= y < n and 0 <= x < m):
continue
if vis[y][x]:
continue
if grid[y][x] not in ('.'):
continue
vis[y][x] = True
for dy, dx in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
dq.append((y + dy, x + dx))
for i in range(n):
for j in range(m):
if grid[i][j] == '.':
if not vis[i][j]:
grid[i][j] = '.'
else:
grid[i][j] = '#'
for row in grid:
print("".join(row))Test details
Test 1 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 8 9 5 5 2 2 5 5 8 7 8 ... |
| correct output |
|---|
| ......... ....*.... .../#\... ../###\.. .*#####*. ... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 4, in <module>
pts = [tuple(map(int, input().split())) for _ in range(n)]
File "/box/input/code.py", line 4, in <listcomp>
pts = [tuple(map(int, input().split())) for _ in range(n)]
EOFError: EOF when reading a lineTest 2 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 4 5 10 5 30 15 30 15 10 |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 4, in <module>
pts = [tuple(map(int, input().split())) for _ in range(n)]
File "/box/input/code.py", line 4, in <listcomp>
pts = [tuple(map(int, input().split())) for _ in range(n)]
EOFError: EOF when reading a lineTest 3 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 29 8 7 13 2 14 2 9 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 34, in <module>
y2, x2 = pts[(i + 1) % k]
IndexError: list index out of rangeTest 4 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 14 5 12 5 25 8 28 13 28 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 4, in <module>
pts = [tuple(map(int, input().split())) for _ in range(n)]
File "/box/input/code.py", line 4, in <listcomp>
pts = [tuple(map(int, input().split())) for _ in range(n)]
EOFError: EOF when reading a lineTest 5 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 12 3 20 7 16 7 9 11 13 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 4, in <module>
pts = [tuple(map(int, input().split())) for _ in range(n)]
File "/box/input/code.py", line 4, in <listcomp>
pts = [tuple(map(int, input().split())) for _ in range(n)]
EOFError: EOF when reading a lineTest 6 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 9 35 33 2 3 2 8 4 8 4 5 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 34, in <module>
y2, x2 = pts[(i + 1) % k]
IndexError: list index out of rangeTest 7 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 30 100 69 6 10 6 14 7 14 7 18 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 34, in <module>
y2, x2 = pts[(i + 1) % k]
IndexError: list index out of rangeTest 8 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 40 60 192 11 3 11 5 10 6 11 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 34, in <module>
y2, x2 = pts[(i + 1) % k]
IndexError: list index out of rangeTest 9 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 50 100 142 1 1 1 7 1 11 1 14 ... |
| correct output |
|---|
| *=====*===*==*................... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 34, in <module>
y2, x2 = pts[(i + 1) % k]
IndexError: list index out of rangeTest 10 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "/box/input/code.py", line 35, in <module>
draw_line(y1, x1, y2, x2)
File "/box/input/code.py", line 16, in draw_line
grid[y][x] = '*'
IndexError: list assignment index out of range