-
zoj1094
zoj094
Matrix multiplication problem is a typical example of dynamical programming.
Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is arbitrary. However, the number of elementary multiplications needed strongly depends on the evaluation order you choose.
For example, let A be a 50*10 matrix, B a 10*20 matrix and C a 20*5 matrix.
There are two different strategies to compute A*B*C, namely (A*B)*C and A*(B*C).
The first one takes 15000 elementary multiplications, but the second one only 3500.
Your job is to write a program that determines the number of elementary multiplications needed for a given evaluation strategy.
(Matrix multiplication problem is a typical example of dynamical programming.
Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is arbitrary. However, the number of elementary multiplications needed strongly depends on the evaluation order you choose.
For example, let A be a 50*10 matrix, B a 10*20 matrix and C a 20*5 matrix.
There are two different strategies to compute A*B*C, namely (A*B)*C and A*(B*C).
The first one takes 15000 elementary multiplications, but the second one only 3500.
Your job is to write a program that determines the number of elementary multiplications needed for a given evaluation strategy.
)
- 2012-06-10 10:38:53下载
- 积分:1
-
zhangzhengyoucalibrate
张正友的摄像机标定源代码,基于vc++和opencv的结合(Zhang Zhengyou camera calibration source code, based on a combination of vc++ and opencv)
- 2014-04-16 12:05:19下载
- 积分:1
-
DS1302
DS1302和LCD1602的组合简单应用(DS1302 and LCD1602 Application together)
- 2010-05-09 19:03:08下载
- 积分:1
-
MAX6675
MAX6675 的说明文件,用于温度采集方面很好用,电路简单,温度准确。(MAX6675 documentation, for the temperature acquisition with good, simple circuit, accurate temperature.)
- 2014-12-19 16:09:42下载
- 积分:1
-
Pentacle
在一个窗口中展现一个会运动的会变化的五角星(Displayed in a window movement will be a change in the five-pointed star)
- 2009-05-31 09:45:00下载
- 积分:1
-
UdpClient-UdpServer
用udp协议通讯示例--包括udp客户端与服务端的源代码。(Examples using udp protocol communications- including the udp client and server source code.)
- 2009-12-27 16:19:00下载
- 积分:1
-
learning-CPlusPlus
This tutorial is
c 2002, Aaron Isotton. You are free to copy and distribute
it as long as you do not charge for it and do not modify it. Please email to
aaron@isotton.com for any inquiries. The official homepage of this document
is http://www.isotton.com/lcpp.html.
- 2011-06-07 21:29:26下载
- 积分:1
-
ITM_17_RS232
说明: Software for ITM-17 dvb-t/T2/c meashurement tuner with RS232
- 2018-12-29 15:50:04下载
- 积分:1
-
080889B
基于驱动层的USB存储设备安全监控技术,一篇不错的关于usb驱动开发的论文。很不错,我受到了不少启发(USB drive-based storage devices layer security monitoring technology, a good development on the usb drive papers. Very good, I was a lot of inspiration)
- 2008-12-16 00:25:04下载
- 积分:1
-
357357666
显示多行文字的工具栏,VC++经典编程源码,很好的参考资料。(Display multiple lines of text toolbar, VC++ classic programming source code, a good reference.)
- 2013-11-14 18:58:34下载
- 积分:1