0
0

傾斜配点 Python3編

Posted at

今まで学んだことを活かせてほっ。
ちなみに答えの方は、maxを使わない方法だった。

N = int(input())
M = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input().split()))) 
    
B = []
sum = 0
for i in range(len(A)):
    for j in range(len(A[i])):
        sum += (A[i][j] * M[j])
        
    B.append(sum)
    sum = 0
    
print(max(B))

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0