Submission details
Task:Monikulmio
Sender:Emerald0X2
Submission time:2025-10-28 09:56:15 +0200
Language:Python3 (PyPy3)
Status:READY
Result:73
Feedback
groupverdictscore
#1ACCEPTED73
Test results
testverdicttimescore
#1ACCEPTED0.04 s7details
#2ACCEPTED0.04 s10details
#3ACCEPTED0.04 s7details
#4ACCEPTED0.04 s7details
#5ACCEPTED0.04 s7details
#6ACCEPTED0.05 s7details
#7ACCEPTED0.06 s7details
#8ACCEPTED0.06 s7details
#9ACCEPTED0.07 s7details
#10ACCEPTED0.11 s7details

Code

board = input()

board = board.split(" ")
points = []
for i in range(int(board[2])):
    new_point = (input().split(" "))
    points.append([int(new_point[0])-1,int(new_point[1])-1])

output = []
line = "."*int(board[1])
for i in range(int(board[0])):
    output.append(list(line))

for point in points: 
    output[point[0]][point[1]] = "*"

current_point = 0
next_point = 1

for i in range(len(points)):
    diff = [points[next_point][0]-points[current_point][0],points[next_point][1]-points[current_point][1]]
    if(diff[0] > 0):
        if(diff[1] > 0):
            for i in range(diff[0]-1):
                output[points[current_point][0] + 1 + i][points[current_point][1] + 1 + i] = "\\"
        elif(diff[1] < 0):
            for i in range(diff[0]-1):
                output[points[current_point][0] + 1 + i][points[current_point][1] - 1 - i] = "/"
        else:
            for i in range(diff[0]-1):
                output[points[current_point][0] + 1 + i][points[current_point][1]] = "|"
    
    elif(diff[0] < 0):
        if(diff[1] < 0):
            for i in range(abs(diff[0]+1)):
                output[points[current_point][0] - 1 - i][points[current_point][1] - 1 - i] = "\\"
        elif(diff[1] > 0):
            for i in range(abs(diff[0]+1)):
                output[points[current_point][0] - 1 - i][points[current_point][1] + 1 + i] = "/"
        else:
            for i in range(abs(diff[0]+1)):
                output[points[current_point][0] - 1 - i][points[current_point][1]] = "|"
    elif(diff[1] > 0):
        for i in range(diff[1]-1):
            output[points[current_point][0]][points[current_point][1]+1+i] = "="
    
    elif(diff[1] < 0):
        for i in range(abs(diff[1]+1)):
            output[points[current_point][0]][points[current_point][1]-1-i] = "="

    current_point += 1
    next_point += 1
    if(next_point > int(board[2])-1):
        next_point = 0

found_inside = False

for i in range(len(output)-1):
    for j in range(len(output[i])-1):
        if((output[i][j] == "\\" or output[i][j] == "/" or output[i][j] == "|" or output[i][j] == "*" or output[i][j] == "=") and found_inside):
            found_inside = False
        
        elif((output[i][j] != "\\" or output[i][j] != "/" or output[i][j] != "|" or output[i][j] != "*" or output[i][j] != "=") and found_inside):
            output[i][j] = "#"

        elif(output[i][j] == "\\" or output[i][j] == "/" or output[i][j] == "|"):
                found_inside = True

for j in range(int(board[0])):
    for i in range(len(output)-1):
        if((output[i][j] == "\\" or output[i][j] == "/" or output[i][j] == "=" or output[i][j] == "*" or output[i][j] == "|") and found_inside):
            found_inside = False
            
        elif((output[i][j] != "\\" or output[i][j] != "/" or output[i][j] != "=" or output[i][j] != "*" or output[i][j] != "=") and found_inside):
            output[i][j] = "#"

        elif(output[i][j] == "\\" or output[i][j] == "/" or output[i][j] == "="):
                found_inside = True

out = ""
for l in output:
    for c in l:
        out += str(c)
    out += "\n"

print(out.strip())

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 1, col 6: expected '.', got '#'

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 5, col 33: 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 1, col 14: 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 1, col 6: 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 1, col 1: 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 1, col 5: 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 1, col 15: 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 1, col 12: expected '.', got '#'