题解 | #求最小公倍数#

矩阵乘法

http://www.nowcoder.com/practice/ebe941260f8c4210aa8c17e99cbc663b

x = int(input())
y = int(input())
z = int(input())
lst_1 = []
lst_2 = []
for i in range(x):
    l1 = list(map(int, input().split()))
    lst_1.append(l1)
for i in range(y):
    l2 = list(map(int, input().split()))
    lst_2.append(l2)
lst_2_new = []
for i in range(z):
    l = []
    for j in range(y):
        l.append(lst_2[j][i])
    lst_2_new.append(l)
res = []
for i in lst_1:
    la = []
    for j in lst_2_new:
        ls = list(map(lambda x,y:x*y, i,j))
        s = sum(ls)
        la.append(s)
    res.append(la)
for line in res:
    line = [str(x) for x in line]
    print(' '.join(line))
    
        
            
    
            
    
    
全部评论

相关推荐

2025-12-15 14:25
云南大学 Java
lei22:入职可能会看学信网,最好别伪装,这个简历找实习肯定是够的,肯定会有收 28 届实习生的公司的,多投就行
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务