-
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
-
ATMEGA32ceshi
TFT数据显示,彩色条纹刷屏,数据输入显示(TFT display data, color stripes scraper, data input display)
- 2011-10-19 07:15:15下载
- 积分:1
-
心形流水灯
基于STC89C52RC的一种超炫的流水灯,代码十分的简洁。(Based on STC89C52RC, a dazzling water lamp, the code is very simple.)
- 2020-06-18 10:00:01下载
- 积分:1
-
两个 cc2530 的 Contiki 之间的通信
Hy vọng có thể giúp 川崎 bạn 芹 !
- 2022-12-12 13:05:10下载
- 积分:1
-
FindAllWin32Process
例子列举所有的进程基类,适合Window编程初学者。(The example gets all the process classes. for the fundamental coder)
- 2015-04-01 20:42:19下载
- 积分:1
-
简单的基于Pelco协议的云台控制程序(附Pelco协议说明)
简单的基于Pelco协议的云台控制程序(附Pelco协议说明)-Based on a simple agreement Pelco PTZ control procedures (with Pelco protocol below)
- 2022-02-24 12:29:37下载
- 积分:1
-
VCMatlab
本文详细介绍了在VC环境下调用Matlab文件的方法,可按照说明一步一步执行(This paper introduces in detail in the VC environment call Matlab documents can follow the step-by-step implementation)
- 2007-12-27 20:11:23下载
- 积分:1
-
PaletteDemo
此代码创建喝使用调色板,是个作为参考代码(This code creates a drink using a palette as a reference code)
- 2013-01-05 16:09:59下载
- 积分:1
-
ARCENGINE地图浏览
云南石林是云南省昆明市东南部的重要景观,位于云南省昆明市石林彝族自治县境内,属亚热带低纬度高原山地季风气候,年平均温度约16度,距省会昆明78公里,“冬无严寒、夏无酷暑、四季如春”,是世界唯一位于亚热带高原地区的喀斯特(溶洞)地貌,保护区总面积约350平方公里。该地区大部分位于山地区域,海拔高度在1500m到1900m之间。
- 2022-04-16 11:19:35下载
- 积分:1
-
spi编码器(3d图+参考程序+文档)
【实例简介】
- 2021-10-25 00:30:56下载
- 积分:1