Problem 2726 --Array - Matrix Vector Multiplication

2726: Array - Matrix Vector Multiplication

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $247$ 正确数量 $302$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL 数学

Matrix Vector Multiplication 

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

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

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

i-th element of a m×1 column vector b is represented by bi (i=1,2,...,m), and the element in i-th row and j-th column of a matrix A is represented by aij (i=1,2,...,n,j=1,2,...,m). 

The product of a n×m matrix A and a m×1 column vector b is a n×1 column vector c, and ci is obtained by the following formula:

In the first line, two integers n and m are given. In the following n lines, aij are given separated by a single space character. In the next mm lines, bi is given in a line.
The output consists of n lines. Print ci in a line.
3 4
1 2 0 1
0 3 0 1
4 1 1 0
1
2
3
0
5
6
9

1≤n,m≤100

0≤bi,aij≤1000

推荐代码 查看2726 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 这名字起得有水准 788291 2021-11-28 23:50:17
内存最少[$0 $KB] AOJ大管家 668688 2020-11-27 12:04:46
第一AC 却又像风捉摸不住 328783 2018-11-24 22:59:55
第一挑战 却又像风捉摸不住 328783 2018-11-24 22:59:55

赛题来源/所属竞赛 会津大学《C++ Programming I》 C++程序设计(入门)

竞赛编号 竞赛名称 竞赛时间 访问比赛
1781 2023-2024-1学期《C语言程序设计》:二维数组【23计算机】 2023-11-25 00:00:00 请登录
1713 2022-2023-1学期《C语言程序设计》:数组排序和二维数组【22计算机】 2022-12-05 00:00:00 请登录
1663 2021-2022-1学期《C语言程序设计》:数组【21计算机】 2021-11-15 00:00:00 请登录
1567 2020-2021-1学期《C语言程序设计》:数组【20计算机12345】 2020-11-16 14:00:00 请登录
1392 2019-2020-1学期《C语言程序设计I》:数组II【19计算机12班】 2019-11-15 10:00:00 请登录