首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > Description 给定一个有N个矩阵的矩阵链A1A2A3...An,矩Ai的维数为pi...

Description 给定一个有N个矩阵的矩阵链A1A2A3...An,矩Ai的维数为pi...

  • 资源大小:397.16 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 其他项目

资 源 简 介

Description 给定一个有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 输出一个整数表示最少要进行的乘法次数。 -Description 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 numbe

文 件 列 表

Debug
JUZHEN.obj
JUZHEN.pch
vc60.idb
vc60.pdb
JUZHEN.plg
JUZHEN.cpp
JUZHEN.dsp
JUZHEN.dsw
JUZHEN.ncb
JUZHEN.opt
VIP VIP
0.178869s