Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 734 Bytes

2740.md

File metadata and controls

36 lines (27 loc) · 734 Bytes

백준 2740번 행렬 곱셈

2740


소스코드

  • 메모리 : 30864 KB
  • 시간 : 248 ms
n, m = map(int, input().split())
A = []
for i in range(n):
    A.append(list(map(int, input().split())))

m, k = map(int, input().split())
B = []
for i in range(m):
    B.append(list(map(int, input().split())))


C = [[0 for i in range(k)] for j in range(n)]

for i in range(n):
    for j in range(k):
        for l in range(m):
            C[i][j] += A[i][l] * B[l][j]

for c in C:
    for cc in c:
        print(cc, end = ' ')
    print()