主页
试题仓库
题目列表
试题分类
经典教材
竞赛作业
竞赛列表
提交状态
图灵学院
TuringMOOC
图灵书屋
图灵商城
图灵实验室
图灵会员
历史荣誉
支持我们
图灵IDE
用户/排名
AOJ排名
实名认证
请登录
常用链接
AOJ考试平台
老赵的Gitee代码
编译原理模拟考试平台
Java技术手册
FCC网站
菜鸟网
在线工具箱
字节豆包GPT
代码可视化
力扣网
牛客网
洛谷
杭电OJ
CodeForce
隐藏编译器
Problem 2726 --Array - Matrix Vector Multiplication
2726: Array - Matrix Vector Multiplication
上一题
正确率: $72.71\%$
下一题
Time Limit
$1$ 秒/Second(s)
Memory Limit
$512$ 兆字节/Megabyte(s)
提交总数
$436$
正确数量
$317$
"
裁判形式
标准裁判/Standard Judge
我的状态
尚未尝试
难度
分类标签
STL
数学
×
为本题添加算法分类(请不要超过5个)
当前分类(单击移除):
STL
数学
单击选择分类:
Description
<p> Matrix Vector Multiplication </p> <p> Write a program which reads a n×m matrix A and a m×1 vector b, and prints their product Ab. </p> <p> A column vector with m elements is represented by the following equation. </p> <p> <img src="/JudgeOnline/upload/image/20181017/20181017192017_90239.png" alt="" /> </p> <p> A n×m matrix with mm column vectors, each of which consists of n elements, is represented by the following equation. </p> <p> <img src="/JudgeOnline/upload/image/20181017/20181017192102_64910.png" alt="" /> </p> <p> 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). </p> <p> 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: </p> <p> <img src="/JudgeOnline/upload/image/20181017/20181017192131_95616.png" alt="" /> </p>
Input
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.
Output
The output consists of n lines. Print ci in a line.
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
提示
<p> 1≤n,m≤100 </p> <p> 0≤bi,aij≤1000 </p>
推荐代码
查看2726 所有题解
上传题解视频得图灵币
本题记录
用 户(点击查看用户)
运行号(点击购买题解)
时 间
算法最快[$0 $ms]
0
内存最少[$0 $KB]
0
第一AC
0
第一挑战
0
赛题来源
会津大学《C++ Programming I》
C++程序设计(入门)
AOJ
Please Login