307. 배열 복원하기

아현·2021년 9월 23일
0

Algorithm

목록 보기
325/400
post-custom-banner

백준






1. 시뮬레이션



import sys
input = sys.stdin.readline

h, w, x, y = map(int, input().split())
alist = [[0] * w for _ in range(h)]
blist = [list(map(int, input().split())) for _ in range(h + x)]

for i in range(h):
    for j in range(w):
        alist[i][j] = blist[i][j]

for i in range(x, h):
    for j in range(y, w):
        temp = alist[i][j] - alist[i - x][j - y]
        alist[i][j] = temp


for lst in alist:
    for l in lst:
        print(l,end=" ")
    print()



profile
For the sake of someone who studies computer science
post-custom-banner

0개의 댓글