반응형
https://www.acmicpc.net/problem/2740
# @Author YoungMinKim
# baekjoon
N,M = map(int,input().split())
matrix1 = []
for _ in range(N):
matrix1.append(list(map(int,input().split())))
M,K = map(int,input().split())
matrix2=[]
for _ in range(M):
matrix2.append(list(map(int,input().split())))
result = [[0 for _ in range(K)] for _ in range(N)]
for n in range(N):
for k in range(K):
for m in range(M):
result[n][k] += matrix1[n][m] * matrix2[m][k]
for i in result:
for j in i:
print(j,end=' ')
print()
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 2750 (0) | 2020.08.25 |
---|---|
baekjoon - python - 2742 (0) | 2020.08.25 |
python - baekjoon - 2741 (0) | 2020.08.25 |
baekjoon - python - 2739 (0) | 2020.08.25 |
baekjoon - python - 2675 (0) | 2020.08.25 |
댓글