| Task: | Monikulmio |
| Sender: | PuskaJamal |
| Submission time: | 2025-10-27 21:44:43 +0200 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | 35 |
| group | verdict | score |
|---|---|---|
| #1 | RUNTIME ERROR | 35 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | 7 | details |
| #2 | RUNTIME ERROR | 0.07 s | 0 | details |
| #3 | RUNTIME ERROR | 0.07 s | 0 | details |
| #4 | RUNTIME ERROR | 0.07 s | 0 | details |
| #5 | RUNTIME ERROR | 0.07 s | 0 | details |
| #6 | ACCEPTED | 0.04 s | 7 | details |
| #7 | ACCEPTED | 0.05 s | 7 | details |
| #8 | RUNTIME ERROR | 0.08 s | 0 | details |
| #9 | ACCEPTED | 0.06 s | 7 | details |
| #10 | ACCEPTED | 0.09 s | 7 | details |
Code
# Koodi, joka toimii:
s = input()
s = s.split()
b = []
for i in range(int(s[0])):
b.append("."*int(s[1]))
c = [0, 0]
for i in range(int(s[2])):
d = input()
e = d.split()
e = [int(e[0]), int(e[1])]
if c == [0, 0]:
c = [int(e[0]), int(e[1])]
u = c
f = b[e[0]-1]
f = f[: e[1]-1] + '*' + f[e[1]:]
b[e[0]-1] = f
if i != int(s[2]):
if e != c:
if e[0] == c[0]:
if c[1]-e[1] < 0:
for i in range(e[1]-c[1]-1):
c = [c[0], c[1]+1]
f = b[c[0]-1]
f = f[: c[1]-1] + '=' + f[c[1]:]
b[e[0]-1] = f
c = [c[0], c[1]+1]
elif c[1]-e[1] > 0:
for i in range(c[1]-e[1]-1):
c = [c[0], c[1]-1]
f = b[c[0]-1]
f = f[: c[1]-1] + '=' + f[c[1]:]
b[e[0]-1] = f
c = [c[0], c[1]-1]
elif e[1] == c[1]:
if c[0]-e[0] < 0:
for i in range(e[0]-c[0]-1):
c = [c[0]+1, c[1]]
f = b[c[0]-1]
f = f[: c[1]-1] + '|' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]+1, c[1]]
elif c[0]-e[0] > 0:
for i in range(c[0]-e[0]-1):
c = [c[0]-1, c[1]]
f = b[c[0]-1]
f = f[: c[1]-1] + '|' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]-1, c[1]]
elif e[0]-c[0] == e[1]-c[1]:
if e[0]-c[0] > 0:
for i in range(e[0]-c[0]-1):
c = [c[0]+1, c[1]+1]
f = b[c[0]-1]
f = f[: c[1]-1] + '\\' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]+1, c[1]+1]
elif e[0]-c[0] < 0:
for i in range(c[0]-e[0]-1):
c = [c[0]-1, c[1]-1]
f = b[c[0]-1]
f = f[: c[1]-1] + '\\' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]-1, c[1]-1]
elif c[0]-e[0] == e[1]-c[1]:
if e[0]-c[0] < 0:
for i in range(c[0]-e[0]-1):
c = [c[0]-1, c[1]+1]
f = b[c[0]-1]
f = f[: c[1]-1] + '/' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]-1, c[1]+1]
elif e[0]-c[0] > 0:
for i in range(e[0]-c[0]-1):
c = [c[0]+1, c[1]-1]
f = b[c[0]-1]
f = f[: c[1]-1] + '/' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]+1, c[1]-1]
else:
if u[0] == c[0]:
if c[1]-u[1] < 0:
for i in range(u[1]-c[1]-1):
c = [c[0], c[1]+1]
f = b[c[0]-1]
f = f[: c[1]-1] + '=' + f[c[1]:]
b[u[0]-1] = f
c = [c[0], c[1]+1]
elif c[1]-u[1] > 0:
for i in range(c[1]-u[1]-1):
c = [c[0], c[1]-1]
f = b[c[0]-1]
f = f[: c[1]-1] + '=' + f[c[1]:]
b[u[0]-1] = f
c = [c[0], c[1]-1]
elif u[1] == c[1]:
if c[0]-u[0] < 0:
for i in range(u[0]-c[0]-1):
c = [c[0]+1, c[1]]
f = b[c[0]-1]
f = f[: c[1]-1] + '|' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]+1, c[1]]
elif c[0]-u[0] > 0:
for i in range(c[0]-u[0]-1):
c = [c[0]-1, c[1]]
f = b[c[0]-1]
f = f[: c[1]-1] + '|' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]-1, c[1]]
elif u[0]-c[0] == u[1]-c[1]:
if u[0]-c[0] > 0:
for i in range(u[0]-c[0]-1):
c = [c[0]+1, c[1]+1]
f = b[c[0]-1]
f = f[: c[1]-1] + '\\' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]+1, c[1]+1]
elif u[0]-c[0] < 0:
for i in range(c[0]-u[0]-1):
c = [c[0]-1, c[1]-1]
f = b[c[0]-1]
f = f[: c[1]-1] + '\\' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]-1, c[1]-1]
elif c[0]-u[0] == u[1]-c[1]:
if u[0]-c[0] < 0:
for i in range(c[0]-u[0]-1):
c = [c[0]-1, c[1]+1]
f = b[c[0]-1]
f = f[: c[1]-1] + '/' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]-1, c[1]+1]
elif u[0]-c[0] > 0:
for i in range(u[0]-c[0]-1):
c = [c[0]+1, c[1]-1]
f = b[c[0]-1]
f = f[: c[1]-1] + '/' + f[c[1]:]
b[c[0]-1] = f
c = [c[0]+1, c[1]-1]
# Oliko ymmärrettävä?
o = 0
n = 0
q = 0
for i in range(len(b)):
print(b[i])
for p in range(len(b)-1):
print("a")
for i in range(len(b[p])):
if b[p][i] != ".":
o+=1
o=o//2
q=0
for i in range(o):
while True:
if b[p][q]!= ".":
n = q+1
break
q+=1
while True:
if b[p][n] == ".":
b[p] = b[p][: n] + '#' + b[p][n+1:]
n+=1
else:
break
for i in range(len(b)):
print(b[i])Test details
Test 1 (public)
Verdict: ACCEPTED
| input |
|---|
| 8 9 5 5 2 2 5 5 8 7 8 ... |
| correct output |
|---|
| ......... ....*.... .../#\... ../###\.. .*#####*. ... |
| user output |
|---|
| ......... ....*.... .../.\... ../...\.. .*.....*. ... |
Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 5: expected '#', got '.'
Test 2 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 4 5 10 5 30 15 30 15 10 |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Error:
Traceback (most recent call last):
File "input/code.py", line 158, in <module>
if b[p][q]!= ".":
IndexError: string index out of rangeTest 3 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 29 8 7 13 2 14 2 9 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Error:
Traceback (most recent call last):
File "input/code.py", line 158, in <module>
if b[p][q]!= ".":
IndexError: string 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 |
|---|
| ................................. |
Error:
Traceback (most recent call last):
File "input/code.py", line 158, in <module>
if b[p][q]!= ".":
IndexError: string index out of rangeTest 5 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 20 40 12 3 20 7 16 7 9 11 13 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Error:
Traceback (most recent call last):
File "input/code.py", line 163, in <module>
if b[p][n] == ".":
IndexError: string index out of rangeTest 6 (public)
Verdict: ACCEPTED
| input |
|---|
| 9 35 33 2 3 2 8 4 8 4 5 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 3: expected '#', got '.'
Test 7 (public)
Verdict: ACCEPTED
| input |
|---|
| 30 100 69 6 10 6 14 7 14 7 18 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Lines are drawn correctly. Incorrect fill character on row 7, col 10: expected '#', got '.'
Test 8 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 40 60 192 11 3 11 5 10 6 11 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Error:
Traceback (most recent call last):
File "input/code.py", line 163, in <module>
if b[p][n] == ".":
IndexError: string index out of rangeTest 9 (public)
Verdict: ACCEPTED
| input |
|---|
| 50 100 142 1 1 1 7 1 11 1 14 ... |
| correct output |
|---|
| *=====*===*==*................... |
| user output |
|---|
| *=====*===*==*................... |
Feedback: Lines are drawn correctly. Incorrect fill character on row 2, col 11: expected '#', got '.'
Test 10 (public)
Verdict: ACCEPTED
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| ...*====*........................ |
Feedback: Lines are drawn correctly. Incorrect fill character on row 2, col 6: expected '#', got '.'
