BOJ - 3023 - 마술사 이민혁

Updated:

def solution():
    H, W = map(int, input().split())

    data = []

    for i in range(H):
        data.append(str(input()))

    y, x = map(int, input().split())

    for i in range(H):
        data[i] += data[i][::-1]

    for i in range(H):
        data.append(data[H - i - 1])


    for i in range(H*2):
        if i == y - 1:
            ret = ""
            for j in range(W*2):
                if j == x - 1:
                    if data[i][j] == '.':
                        ret += '#'
                    else:
                        ret += '.'
                else:
                    ret += data[i][j]
            print(ret)
            continue

        print(data[i])
solution()

https://www.acmicpc.net/problem/3023

Categories:

Updated:

Leave a comment