Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

Matrix Vector Multiplication

Write a program which reads a $ n \times m$ matrix $A$  and a $m \times 1$ vector $b$, and prints their product $Ab$.

  A column vector with m elements is represented by the following equation.

\[
  b = \left(
    \begin{array}{c}
      b_1  \\
      b_2  \\
      : \\ 
      b_m \\ 
    \end{array}
  \right)
\]

  A $n \times m$ matrix with $m$ column vectors, each of which consists of $n$ elements, is represented by the following equation.

\[
  A = \left(
    \begin{array}{cccc}
      a_{11} & a_{12} & ... & a_{1m} \\
      a_{21} & a_{22} & ... & a_{2m} \\
       :    &   :   &  :  &  : \\
      a_{n1} & a_{n2} & ... & a_{nm} \\
    \end{array}
  \right)
\]

  $i$-th element of a $m \times 1$ column vector $b$ is represented by $b_i$ ($i = 1, 2, ..., m$), and the element in $i$-th row and $j$-th column of a matrix $A$ is represented by $a_{ij}$ ($i = 1, 2, ..., n,$  $j = 1, 2, ..., m$).

The product of a $n \times m$ matrix $A$ and a $m \times 1$ column vector $b$ is a $n \times 1$ column vector $c$, and $c_i$ is obtained by the following formula:

\[
c_i = \sum_{j=1}^m a_{ij}b_j  = a_{i1}b_1 + a_{i2}b_2 + ... + a_{im}b_m
\]

Input

  In the first line, two integers $n$ and $m$ are given. In the following $n$ lines, $a_{ij}$ are given separated by a single space character. In the next $m$ lines, $b_i$ is given in a line.

Output

  The output consists of $n$ lines. Print $c_i$ in a line.

Constraints

$1 \leq n, m \leq 100$

$0 \leq b_i, a_{ij} \leq 1000$

Sample Input

3 4
1 2 0 1
0 3 0 1
4 1 1 0
1
2
3
0

Sample Output

5
6
9



Sample input:
3 4
1 2 0 1
0 3 0 1
4 1 1 0
1
2
3
0


Sample output:
5
6
9

Submission status: Runtime Error

Solution code:
# n*m?????????A??¨m*1??????????????????b??¨??????????¨????????????°??????

import numpy as np
n, m = map(int, input().split())

A = np.matrix([[0 for i in range(m)] for j in range(n)])
for i in range(n):
    A[i] = list(map(int, input().split()))

b = np.matrix([[0] for i in range(m)])
for i in range(m):
    b[i] = int(input())

c = np.matrix([[0] for i in range(n)])            #A??b

for i in range(n):
    print(c[i, 0])

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Here your code !

import numpy

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = numpy.array( [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ] )
        vector = numpy.array( [ int( input().rstrip() ) for i in range(m) ] )
    except:
        return inputError()

    result = numpy.dot(matrix,vector)
    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Here your code !

from numpy import array, dot

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = array( [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ] )
        vector = array( [ int( input().rstrip() ) for i in range(m) ] )
    except:
        return inputError()

    result = dot(matrix,vector)
    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()

Submission status: Runtime Error

Solution code:
m, n = [int (input().split(" ")]

a =[ [int(i) for i in input().split(" ")] for _ in range(n) ]
b =[]
for i in range(m):
    b.append( int(input()) )


for x in range(n):
    result = 0
    for y in range(m):
        result += a[x][y] * b[y]
    print(result)

Submission status: Runtime Error

Solution code:
n, m = [int (input().split(" ")]

a =[ [int(i) for i in input().split(" ")] for _ in range(n) ]
b =[]
for i in range(m):
    b.append( int(input()) )


for x in range(n):
    result = 0
    for y in range(m):
        result += a[x][y] * b[y]
    print(result)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
A = [[0 for i in range(m)] for j in range(n)]

for i in range(n):
    A[i][0], A[i][1], A[i][2], A[i][3] = map(int, input().split())

b = [0 for i in range(m)]
for i in range(m):
    b[i] = int(input())

for i in range(n):
    c = 0
    for j in range(m):
        c += A[i][j] * b[j]
    print(c)

Submission status: Runtime Error

Solution code:
import numpy as np

n, m = list(map(int, input().split()))
a = [[0] for i in range(n)]
v = [[0] for j in range(m)]
for i in range(n):
    a[i][:] = list(map(int, input().split()))
for j in range(m):
    v[j][0] = int(input())
A = np.matrix(a)
V = np.matrix(v)
B = A * V
for i in range(n):
    print(B[i][0])

Submission status: Runtime Error

Solution code:
import numpy as np

n, m = map(int, input().split())

A = np.empty((0, m), int)
b = np.empty((0, 1), int)

for i in range(n):
    A = np.append(A, np.array([list(map(int, input().split()))]), axis=0)

for i in range(m):
    b = np.append(b, np.array([list(map(int, input().split()))]), axis=0)

c = np.dot(A, b)

for i in range(n):
    print(int(c[i]))

Submission status: Runtime Error

Solution code:
i,j=map(int,input().split())
mn=[]
n=[]
for _ in range(i):
    mn.append(list(map(int,input().split())))
for _ in range(j):
    n.append(list(map(int,input().split())))

import numpy as np
x=np.array(mn)
y=np.array(n)
ret=x*y
for num in range(i):
    print(sum(ret[num]))

Submission status: Runtime Error

Solution code:
import numpy as np
i,j=map(int,input().split())
mn=[]
n=[]
for _ in range(i):
    mn.append(list(map(int,input().split())))
for _ in range(j):
    n.append(int(input()))

x=np.array(mn)
y=np.array(n)
ret=x*y

for num in range(i):
    print(sum(ret[num]))

Submission status: Runtime Error

Solution code:
m = input()
n = input()
i = 0
j = 0
list = []
while i < m:
    while j < n:
        k = input()
        list.append(k)
        j += 1
    i += 1
i = 0
list2 = []
while i < n:
    k = input()
    list2.append(k)
    i += 1
i = 0
j = 0
k = 0
while i < m:
    while j < n:
        t = list[j + k]
        s = list2[j]
        sum += t * s
        j += 1
    print(sum)
    i += 1
    k += 4

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[]
b=[]
z=[]
x=[]
for i in range(n):
    a+=[[int(i) for i in input().split()]]
for i in range(m):
    b+=[[int(i) for i in input().split()]]
for i in range(n):
    for j in range(m):
        z+=[a[i][j]*b[j][0]]
    x+=[sum(z)]
    z=0
for i in range(m):
    print(x[m])

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[]
b=[]
z=[]
x=[]
for i in range(n):
    a+=[[int(i) for i in input().split()]]
for i in range(m):
    b+=[[int(i) for i in input().split()]]
for i in range(n):
    for j in range(m):
        z+=[a[i][j]*b[j][0]]
    x+=[sum(z)]
    z=0
for i in range(m):
    print(x[i])

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[]
b=[]
z=[]
x=[]
for i in range(n):
    a+=[[int(i) for i in input().split()]]
for i in range(m):
    b+=[[int(i) for i in input().split()]]
for i in range(n):
    for j in range(m):
        z+=[a[i][j]*b[j][0]]
    x+=[sum(z)]
    z=[]
for i in range(m):
    print(x[i])

Submission status: Runtime Error

Solution code:
import numpy as np
n,m=map(int,input().split())
a,b=[],[]
for i in range(n):
    a.append(list(map(int,input().split())))
for i in range(m):
    b.append(list(map(int,input().split())))
a=np.array(a)
b=np.array(b)
x=np.dot(a, b, out = None)
for i in x:
    print(*i)

Submission status: Runtime Error

Solution code:
N, M=map(int, input().split())
mat = [[0 for m in range(M)]for n in range(N)]
vec = [0 for m in range(M)]

for n in range(N):
  mat[n] = list(map(int , input().split()))
for m in range(m):
  vec[m] = int(input())

c = 0
for n in range(N):
 for m in range(M):
  c += mat[n][m] * vec[m]
 print(c)
 c = 0

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = [[int(n) for n in input().split()] for i in range(n)]
b = []
for i in range(m):
    b.append(int(input()))
c = [0 for i in range(m)]
for i in range(n):
    for j in range(m):
        c[i] += a[i][j] * b[j]
    print(c[i])

Submission status: Runtime Error

Solution code:
n, m = map(int,raw_input().split())
matrix = []
for i in range(n):
    matrix.append(map(int,raw_input().split()))

vector = []
for i in range(m):
    vector.append(int(raw_input()))

for i in range(m):
    for j in range(n):
        print sum([vector[j] * matrix[i][j]])

Submission status: Runtime Error

Solution code:
import numpy as np
n,m=list(map(int,input().split()))
A=[]
B=[]
for i in range(n):A.append(list(map(int,input().split())))
for i in range(m):B.append(int(input()))
k=np.dot(A,B)
print('\n'.join(map(str,k.tolist())))

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())

A = []
for i in range(n):
    A.append(list(map(int, input().split())))

b = []
for i in range(m):
    b.append(int(input()))

import numpy as np
c = np.array(A).dot(b)

for ci in c:
    print(ci)

Submission status: Runtime Error

Solution code:
import numpy as np

n,m = map(int, input().split())

A = []
for i in range(n):
    A.append(list(map(int, input().split())))

b = []
for i in range(m):
    b.append(int(input()))

c = np.array(A).dot(b)

for ci in c:
    print(ci)

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
A = [[]*b for i in range(a)]
B = [] * b

for i in range(a):
    A[i] = map(int,input().split())

for i in range(b):
    B[i] = int(input())

for i in range(a):
    s=0
    for j in range(b):
        s+=A[i][j]*B[j]
    print(s)

Submission status: Runtime Error

Solution code:
n,m=map(int, input().split())
for _ in range (n):
 A=list(map(int, input().split())
for _ in range (m):
 b=int(input())
 for _ in range (n):
  print(sum(a[_][i] * b[i] for i in range(m)))

Submission status: Runtime Error

Solution code:
n,m=map(int, input().split())
A=[list(map(int, input().split()) for _ in range (n)]
b=[int(input()) for _ in range (m)]
for _ in range (n):
 print(sum(a[_][i] * b[i] for i in range(m)))

Submission status: Runtime Error

Solution code:
import numpy as np
n,m = map(int,input().split())
arr = [[0 for i in range(m)]for j in range(n)]
for i in range(n):
    line = input().split()
    for j in range(m):
        arr[i][j] = int(line[j])
array = np.array(arr)
colvec = np.array([])
for _ in range(m):
    colvec = np.append(colvec,int(input()))
for i in range(n):
    print('{}'.format(format(int(array[i].dot(colvec)))))

Submission status: Runtime Error

Solution code:
import numpy as np
n,m = map(int,input().split())
arr = [[0 for i in range(m)]for j in range(n)]
for i in range(n):
    line = input().split()
    for j in range(m):
        arr[i][j] = int(line[j])
array = np.array(arr)
colvec = np.array([])
for i in range(m):
    colvec = np.append(colvec,int(input()))
for i in range(n):
    print('{}'.format(format(int(array[i].dot(colvec)))))

Submission status: Runtime Error

Solution code:
import numpy as np
n,m = map(int,input().split())
arr = [[0 for i in range(m)]for j in range(n)]
colvec = np.array([])
for i in range(n):
    line = input().split()
    for j in range(m):
        arr[i][j] = int(line[j])
for _ in range(m):
    colvec = np.append(colvec,int(input()))
array = np.array(arr)
for i in range(n):
    print('{}'.format(format(int(array[i].dot(colvec)))))

Submission status: Runtime Error

Solution code:
import numpy as np
n,m = map(int,input().split())
arr = [[0 for i in range(m)]for j in range(n)]
colvec = np.array([])
for i in range(n):
    line = input().split()
    for j in range(m):
        arr[i][j] = int(line[j])
for _ in range(m):
    colvec = np.append(colvec,int(input()))
array = np.array(arr)
for i in range(n):
    print('{}'.format(int(array[i].dot(colvec))))

Submission status: Runtime Error

Solution code:
n, m = map(int, raw_input().split())
a, b = [], []
for _ in range(n):
	a.append(map(int, raw_input().split()))
for _ in range(m):
	b.append(int(raw_input()))
for i in range(n):
	c[i] = 0
	for j in range(m):
		c[i] += a[i][j]*b[j]
	print c[i]

Submission status: Runtime Error

Solution code:
'''
1 1 1
2 2 2
1
2
3
とあったら、1*1+1*2+1*3
          2*1+2*2+2*3
みたいな感じ。
'''

from operator import add
from functools import reduce

#テスト値
n = int(input())
m = int(input())
#a = [[1,1,1],[2,2,2]]
#b = [1,2,3]

a = [list(map(int, input().split())) for n in range(n)]
#print(a)

b = [int(input()) for n in range(m)]
#print(b)

#ベクトル積の計算。
#まず行ごとの値を計算。
c = []
for n in range(n):
    c.append([a[n][m]*b[m] for m in range(m)])
    
#print(c)#ここまでOK。

d=[reduce(add,c[n]) for n in range(len(c))]



#print(d)

[print(d[i]) for i in range(len(d))]

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[list(map(int,input().split()))
b=[int(input())for i in range(m)]
[print(sum([j*k for j,k in zip(a[i],b])) for i in range(n)]

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
b=[int(input())for i in range(m)]
[print(sum([j*k for j,k in zip(a[i],b])) for i in range(n)]

Submission status: Runtime Error

Solution code:



n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
b=[int(input())for i in range(m)]
[print(sum([j*k for j,k in zip(a[i],b])) for i in range(n)]

Submission status: Runtime Error

Solution code:


n,m=map(int,input().split())
a=[list(map(int,input().split()))for i in range(n)]
b=[int(input())for i in range(m)]
[print(sum([j*k for j,k in zip(a[i],b]))for i in range(n)]

Submission status: Runtime Error

Solution code:

n,m=map(int,input().split())
a=[list(map(int,input().split()))for f in range(n)]
b=[int(input())for g in range(m)]
[print(sum([j*k for j,k in zip(a[i],b]))for i in range(n)]

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[list(map(int,input().split()))for _ in range(n)]
b=[int(input())for _ in range(m)]
[print(sum([j*k for j,k in zip(a[i],b]))for i in range(n)]

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=[list(map(int,input().split()))for _ in range(n)]
b=[int(input())for _ in range(m)]
[print(sum([j*k for j,k in zip(a[i],b]))for i in range(n)]
~

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

n = list(map(int, input().split()))
a = np.array(n[0] * n[1])

for i in range(n[0]):
    a_line = list(map(int, input().split()))
    np.append(a, a_line)
a.reshape(n[0], n[1])

b = np.array(n[1])
for i in range(n[1]):
    b_column = list(map(int, input().split()))
    np.append(b_column)
b.reshape(n[0], 1)

ab_sum = np.dot(a, b)

for i in range(n[1]):
    print('{0}'.format(ab_sum[i]))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import numpy as np

n = list(map(int, input().split()))

a = np.array(list(map(int, input().split())))
for i in range(n[0] - 1):
    a = np.vstack((a, list(map(int, input().split()))))

b = np.array(list(map(int, input().split())))
for i in range(n[1] - 1):
    b = np.vstack((b, list(map(int, input().split()))))

ab_sum = np.dot(a, b)
for i in range(n[0]):
    print(ab_sum[i])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import numpy as np

n = list(map(int, input().split()))

a = np.array(list(map(int, input().split())))
for i in range(n[0] - 1):
    a = np.vstack((a, list(map(int, input().split()))))

b = np.array(list(map(int, input().split())))
for i in range(n[1] - 1):
    b = np.vstack((b, list(map(int, input().split()))))

ab_sum = np.dot(a, b)
for i in range(n[0]):
    print('{0}'.format(int(ab_sum[i])))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

n = list(map(int, input().split()))

a = np.array(list(map(int, input().split())))
for i in range(n[0] - 1):
    a = np.vstack((a, list(map(int, input().split()))))

b = np.array(list(map(int, input().split())))
for i in range(n[1] - 1):
    b = np.vstack((b, list(map(int, input().split()))))

ab_sum = np.dot(a, b)
for i in range(n[0]):
    print('{0}'.format(int(ab_sum[i])))

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
numberList = []
for i in n:
    childNumberList = list(map(int, input().split()))
    numberList.append(childNumberList)

for j in range(0, n):
    totalNum = 0
    num = int(input())
    for k in range(0, m):
        totalNum += numberList[j][k] * num
    print(totalNum)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
List1 = [[0 for i in range(m)] for i in range(n)]
for x in range(n):
    List1[x] = list(map(int, input().split()))
List2 = [int(input()) for i in range(n + 1)]
sum = [0 for i in range(n)]
for x in range(n):
    for y in range(m):
        sum[x] += List1[x][y] * List2[y]
for x in range(n):
    print(sum[x])

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
List1 = [[0 for i in range(m)] for i in range(n)]
for x in range(n):
    List1[x] = list(map(int, input().split()))
List2 = [int(input()) for _ in range(n)]
sum = [0 for i in range(n)]
for x in range(n):
    for y in range(m):
        sum[x] += List1[x][y] * List2[y]
for x in range(n):
    print(sum[x])

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
A=[input().split()for _ in[0]*n]
b=[input()for _ in[0]*m]
for a in A:print(sum(x*y for x,y in map(int,zip(a,b))))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
A=[[] for i in range(n)]
for i in range(n):
	A[i] = list(map(int,input().split()))
b = []
c = list(map(int,'0'*m))
for i in range(m):
	b.append(int(input())) 
for i in range(n):
	for j in range(m):
		c[i] += A[i][j]*b[j]
for i in range(n):		
	print(c[i])

Submission status: Runtime Error

Solution code:
bfr = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())
for _ in range(n):
    b, f, r, v = map(int, input().split())
    bfr[b-1][f-1][r-1] += v
for b in range(4):
    for f in range(3):
        print(' ' + ' '.join(map(str, bfr[b][f])))
    if b != 3:
        print('#'*20)

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
Li = [[] for y in range(m)]
Li2 = []
a = 0
for x in range(n):
    Li[x] += list(map(int, input().split()))
for x in range(m):
    Li2.append(int(input()))
for x in range(n):
    for y in range(m):
        a += Li[x][y]*Li2[y]
    print(a)
    a = 0

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
Li = [[] for y in range(m)]
Li2 = []
a = 0
for x in range(n):
    Li[x] += list(map(int, input().split()))
for x in range(m):
    Li2.append(int(input()))
for x in range(n):
    for y in range(m):
        a += Li[x][y]*Li2[y]
    print(a)
    a = 0

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
Li = [[] for y in range(m)]
Li2 = []
a = 0
for x in range(n):
    Li[x] += list(map(int, input().split()))
for x in range(m):
    Li2.append(int(input()))
for x in range(n):
    for y in range(m):
        a += Li[x][y]*Li2[y]
    print(a)
    a = 0

Submission status: Runtime Error

Solution code:
import numpy as np
k=input().split()
n=int(k[0])
m=int(k[1])
a=np.zeros((n,m),dtype='int32')
b=np.zeros(m,dtype='int32')
for i in range(n):
    k=input().split()
    for j in range(m):
        a[i][j]=int(k[j])    

for i in range(m):
    b[i]=int(input())
for i in range(n):
    c=0
    for j in range(m):
        c+=a[i][j]*b[j]
    print(c)

Submission status: Runtime Error

Solution code:

import sys
import numpy as np

n, m = input().strip().split(" ")
n = int(n) ;m = int(m)

c = n

a = []
for line in sys.stdin :
    a.append(line)
    c -= 1
    if c == 0 :
        break

c = m

b = []
for line in sys.stdin :
    b.append(line)
    c -= 1
    if c == 0 :
        break

for i in range(0, len(a)) :
    a[i] = a[i].strip().split(" ")
    for j in range(0, len(a[i])) :
        a[i][j] = int(a[i][j])

for i in range(0, len(b)) :
    b[i] = int(b[i].strip())

a = np.array(a)
b = np.array(b)

for i in np.dot(a, b) :
    print(i)

Submission status: Runtime Error

Solution code:
n, m = list(map(int, input().split()))
a=[]
for i in range(n):
	a.append([int(j) for j in input().split()])
for j in range(n):
	s = 0
	for j in range(m):
		s += a[i][j] * b[j]
	print(s)

Submission status: Runtime Error

Solution code:
n, m = list(map(int, input().split()))
a=[]
for i in range(n):
	a.append([int(j) for j in input().split()])
b = []
for i in range(m)
	b.append(int(input()))
for j in range(n):
	s = 0
	for j in range(m):
		s += a[i][j] * b[j]
	print(s)

Submission status: WA: Presentation Error

Solution code:
n, m = map(int, input().split())
a = list()
for i in range(n) :   #1行ずつn行まで読み込みlistに格納
  a.append(list(map(int, input().split())))
b = list()
for j in range(m) :
  b.append(int(input()))
  
for i in range(n) :
  s = 0
  for j in range(m) :
    s += a[i][j] * b[j]
  print(s)
print()

Submission status: WA: Presentation Error

Solution code:
#a???A?????????,b???A??????
a,b=map(int,input().split())
A=[]
B=[]
for i in range(a):
	A.append([int(j) for j in input().split()])

for i in range(b):
	B.append(int(input()))


for i in range(a):
	s=0
	for j in range(b):
		s+=A[i][j]*B[j]
	print(s)
print()

Submission status: WA: Presentation Error

Solution code:
n, m = map(int, input().split())
mat = []
for _ in range(n):
    mat.append(list(map(int, input().split())))

vec = []
for _ in range(m):
    vec.append(int(input()))

result = []
for line in mat:
    c = sum([line[i] * vec[i] for i in range(m)])
    result.append(c)

print("\n".join(map(str, result)), end="")

Submission status: WA: Presentation Error

Solution code:
行数, 列数 = map(int, input().split())

#行列の初期化
行列 = [[0 for _ in range(列数)] for __ in range(行数)]

#データをもとに行列を作成
for 現在行 in range(行数):
    行データ = list(map(int, input().split()))
    for 現在列 in range(列数):
        行列[現在行][現在列] = 行データ[現在列]

#ベクトルデータを取得
ベクトル = [0 for _ in range(列数)]
for 現在行 in range(列数):
    ベクトル[現在行] = int(input())

答え = []
#ベクトルを掛ける
for i in range(行数):
    c = 0
    for j in range(列数):
        c += 行列[i][j] * ベクトル[j]
        
    答え.append(c)

#表示
for i in range(len(答え)):
    print(答え[i], end="")
    print(" ")

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(rst)

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(str(rst))

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

rsts = []
for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    rsts.append(rst)

for rst in rsts:
    print(rst)

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

rsts = []
for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    rsts.append(rst)

for rst in rsts:
    print(rst)

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(rst, end='')
    if i != n-1: print('')

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

rsts = []
for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    rsts.append(rst)

for i in range(n):
    print(rsts[i])

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]

a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

rsts = []
for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    rsts.append(rst)

for i in range(n):
    print(rsts[i])

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]
a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(rst)

Submission status: WA: Presentation Error

Solution code:
#! python3
# matrix_vector_multiplication.py

n, m = [int(x) for x in input().split(' ')]
a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(rst)

Submission status: WA: Presentation Error

Solution code:
n, m = [int(x) for x in input().split(' ')]
a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(str(rst))

Submission status: WA: Presentation Error

Solution code:
n, m = [int(x) for x in input().split(' ')]
a = [[int(x) for x in input(' ').split()] for i in range(n)]
b = [int(input()) for i in range(m)]

for i in range(n):
    rst = 0
    for j in range(m):
        rst += a[i][j] * b[j]
    print(str(rst))

Submission status: WA: Presentation Error

Solution code:
n,m = map(int, input().split())
Li = [[] for y in range(m)]
Li2 = []
a = 0
for x in range(n):
    Li[x] += list(map(int, input().split()))
for x in range(m):
    Li2.append(int(input()))
print()
for x in range(n):
    for y in range(m):
        a += Li[x][y]*Li2[y]
    print(a)
    a = 0