-
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
-
zhixianyundong
悬挂系统实现两电机控制实现悬挂物体的直线运动(Suspension system to achieve two motor control to achieve linear motion of objects hanging)
- 2013-08-30 11:13:25下载
- 积分:1
-
EffectiveCPP
Effctive C++,一本不错的书,值得一看(Effctive C++, a good book, worth a visit)
- 2012-11-10 10:27:38下载
- 积分:1
-
ChainShop
连锁店指纹考勤系统,每次考勤成功都会显示被考勤人员的照片。数据库是基于XML小型数据库。界面友好,操作方便!(Chain fingerprint attendance system, each successful attendance will show pictures of attendance officers. Database is based on the small XML database. User-friendly, easy to operate!)
- 2007-09-04 21:34:49下载
- 积分:1
-
sunxinCPPPPT
VC++高级编程孙鑫全20讲PPT讲义,是学习C++的好工具(this is a PPT,about VC++)
- 2011-10-12 19:02:50下载
- 积分:1
-
MFCdll
用MFC来编写的动态链接库,演示了三种形式的链接(To write with MFC dynamic link library that demonstrates three forms of links)
- 2013-06-28 20:01:21下载
- 积分:1
-
WSSccrSaverI
WINDOWS下可可播放多媒体文件和其它
(Under WINDOWS cocoa to play multimedia files and other)
- 2012-08-16 09:05:35下载
- 积分:1
-
683634
会发声的按钮,VC++经典编程源码,很好的参考资料。(Will sound button, VC++ classic programming source code, a good reference.)
- 2013-11-14 10:22:27下载
- 积分:1
-
CodeRainTest
很漂亮的代码雨,为什么一定要20字啊,好无赖啊(The code is very beautiful rain, why must 20 words, ah, ah good rogue)
- 2013-12-26 19:14:53下载
- 积分:1
-
111019
拓扑,直接插入,冒泡,简单选择,希尔,快速,堆排序(Topology, Direct insertion, Bubble, simple selection, Hill, Quick, heap sort)
- 2018-10-27 01:17:58下载
- 积分:1