Submission details
Task:Monikulmio
Sender:PuskaJamal
Submission time:2025-10-27 22:00:33 +0200
Language:Python3 (PyPy3)
Status:READY
Result:76
Feedback
groupverdictscore
#1ACCEPTED76
Test results
testverdicttimescore
#1ACCEPTED0.04 s10details
#2ACCEPTED0.04 s10details
#3ACCEPTED0.04 s7details
#4ACCEPTED0.04 s7details
#5ACCEPTED0.04 s7details
#6ACCEPTED0.04 s7details
#7ACCEPTED0.06 s7details
#8ACCEPTED0.05 s7details
#9ACCEPTED0.05 s7details
#10ACCEPTED0.08 s7details

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 p in range(len(b)):
    o=0
    for i in range(len(b[p])):
        if b[p][i] != ".":
             o+=1
    q=0
    for i in range(o-1):
        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
.........
....*....
.../#\...
../###\..
.*#####*.
...

Test 2 (public)

Verdict: ACCEPTED

input
20 40 4
5 10
5 30
15 30
15 10

correct output
.................................

user output
.................................

Test 3 (public)

Verdict: ACCEPTED

input
20 40 29
8 7
13 2
14 2
9 7
...

correct output
.................................

user output
.................................

Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 31: expected '.', got '#'

Test 4 (public)

Verdict: ACCEPTED

input
20 40 14
5 12
5 25
8 28
13 28
...

correct output
.................................

user output
.................................

Feedback: Lines are drawn correctly. Incorrect fill character on row 5, col 26: expected '#', got '.'

Test 5 (public)

Verdict: ACCEPTED

input
20 40 12
3 20
7 16
7 9
11 13
...

correct output
.................................

user output
.................................

Feedback: Lines are drawn correctly. Incorrect fill character on row 7, col 17: expected '#', got '.'

Test 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 12: 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 9, col 68: expected '#', got '.'

Test 8 (public)

Verdict: ACCEPTED

input
40 60 192
11 3
11 5
10 6
11 7
...

correct output
.................................

user output
.................................

Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 30: expected '#', got '.'

Test 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 86: expected '#', got '.'