文件名称:JUZHEN
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 397kb
- 下载次数:
- 0次
- 提 供 者:
- 王**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
Descr iption
给定一个有N个矩阵的矩阵链A1A2A3...An,矩Ai的维数为pi-1*pi。我们都知道,使用朴素的矩阵乘法去乘两个维数分别为x,y和y,z的矩阵,所需要的乘法次数为x*y*z。矩阵链乘法问题就是如何对矩阵乘积加括号,使得它们的乘法次数达到最少。
Input
输入的第一行为一个正整数N(1<=N<=200)。表示矩阵的个数。
输入的第二行包含N+1个整数,分别表示pi(0<=i<=N),其中每个pi在[1,200]范围内。
Output
输出一个整数表示最少要进行的乘法次数。
-Descr iption Given a matrix N a matrix chain A1A2A3 ... An, moments Ai dimension of pi-1* pi. We all know that the use of simple matrix multiplication to multiply two dimensions, respectively x, y, and y, z matrix, the required number of multiplication x* y* z. Matrix-chain multiplication problem is how to add the product to the matrix in parentheses, allowing them to reach a minimum number of multiplication. Input input first acts of a positive integer N (1 < = N < = 200). Indicated that the number of matrices. Enter the second line contains N+1 integers, respectively, indicated that pi (0 < = i < = N), where each pi in [1,200] range. Output output, said at least one integer number multiplication to be carried out.
给定一个有N个矩阵的矩阵链A1A2A3...An,矩Ai的维数为pi-1*pi。我们都知道,使用朴素的矩阵乘法去乘两个维数分别为x,y和y,z的矩阵,所需要的乘法次数为x*y*z。矩阵链乘法问题就是如何对矩阵乘积加括号,使得它们的乘法次数达到最少。
Input
输入的第一行为一个正整数N(1<=N<=200)。表示矩阵的个数。
输入的第二行包含N+1个整数,分别表示pi(0<=i<=N),其中每个pi在[1,200]范围内。
Output
输出一个整数表示最少要进行的乘法次数。
-Descr iption Given a matrix N a matrix chain A1A2A3 ... An, moments Ai dimension of pi-1* pi. We all know that the use of simple matrix multiplication to multiply two dimensions, respectively x, y, and y, z matrix, the required number of multiplication x* y* z. Matrix-chain multiplication problem is how to add the product to the matrix in parentheses, allowing them to reach a minimum number of multiplication. Input input first acts of a positive integer N (1 < = N < = 200). Indicated that the number of matrices. Enter the second line contains N+1 integers, respectively, indicated that pi (0 < = i < = N), where each pi in [1,200] range. Output output, said at least one integer number multiplication to be carried out.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
JUZHEN.plg
Debug\JUZHEN.obj
.....\JUZHEN.pch
.....\vc60.idb
.....\vc60.pdb
JUZHEN.cpp
JUZHEN.dsp
JUZHEN.dsw
JUZHEN.ncb
JUZHEN.opt
Debug
Debug\JUZHEN.obj
.....\JUZHEN.pch
.....\vc60.idb
.....\vc60.pdb
JUZHEN.cpp
JUZHEN.dsp
JUZHEN.dsw
JUZHEN.ncb
JUZHEN.opt
Debug