当前位置: 首页 > news >正文

web前端培训机构推荐专业搜索引擎seo服务

web前端培训机构推荐,专业搜索引擎seo服务,做个自己的影院网站怎么做,做网站税费Monge矩阵 对一个m*n的实数矩阵A&#xff0c;如果对所有i&#xff0c;j&#xff0c;k和l&#xff0c;1≤ i<k ≤ m和1≤ j<l ≤ n&#xff0c;有 A[i,j]A[k,l] ≤ A[i,l]A[k,j] 那么&#xff0c;此矩阵A为Monge矩阵。 换句话说&#xff0c;每当我们从矩阵中挑…

Monge矩阵

对一个m*n的实数矩阵A,如果对所有i,j,k和l,1≤ i<k ≤ m和1≤ j<l ≤ n,有          A[i,j]+A[k,l] ≤ A[i,l]+A[k,j]   那么,此矩阵A为Monge矩阵。

换句话说,每当我们从矩阵中挑出两行与两列,并且考虑行列交叉处的4个元素,左上角与右下角的和小于或等于左下角与右上角元素的和。

例如,下面这个就是一个Monge矩阵

(1)证明一个矩阵为Monge阵,当且仅当对所有i=1,2,...,m-1和j=1,2,...,n-1,有            A[i,j]+A[i+1,j+1] ≤ A[i,j+1]+A[i+1,j]

(提示:在当部分,对行、列分别使用归纳法。)

(2)下面的矩阵不是Monge阵。改变一个元素,把它变成Monge矩阵

             37       23       22      32

             21        6       27      10

             53       34       30      31

             32       13        9       6

             43       21       15       8

很明显是要改27,27可以改成【2,5】内的任何一个实数

(3)假设f(i)是第i行包含最左端最小值的列的索引值。证明对任何的m x n Monge矩阵,有f(1) ≤ f(2) ≤...≤ f(m)。

(4)下面是一个用来计算m x n 的Monge矩阵A中每一行的最左最小值的分治算法的描述:

   构造一个包含所有A的偶数行的子矩阵A'。递归地计算A'中每一行的最左端最小值。然后计算A中奇数行的最左端最小值。

   解释如何能在O(m+n)时间内计算出A的奇数行的最左端最小值?(在偶数行最左最小值已知的情况下)

解释:看下面的代码就很明显了。

其实这个算法,我个人感觉,就结构而言比较像分治,但是就思想而言比较像动态规划。

(5)写出(4)所描述算法的运行时间的递归式,并证明其解为O(m+nlogm)

T(m)=T(m/2)+ O(m+n)(求解略)

我的代码:
 

#include<iostream>
using namespace std;void calculate(double **A, int r1, int r2, int min, int max, int *f)	//计算f(r1)到f(r2)
{if (r1 > r2)return;int r = (r1 + r2) / 2;int result = min;int flag = A[r][min];for (int i = min + 1; i <= max; i++)	//寻找最左最小元素flag,和它的的下标result{if (A[r][i] < flag){flag = A[r][i];result = i;}}f[r] = result;calculate(A, r1, r - 1, min, result, f);calculate(A, r + 1, r2, result, max, f);
}bool isMonge(double **A, int m, int n)	//判断是否是Monge矩阵
{for (int i = 0; i < m - 1; i++)for (int j = 0; j < n - 1; j++)if (A[i][j] + A[i + 1][j + 1]>A[i + 1][j] + A[i][j + 1])return false;return true;
}
int main()
{int m, n;while (cin >> m >> n && m>1 && n > 1){double **A = new double*[m];		//Monge矩阵int *f = new int[m];	//不需要在主函数里面进行初始化,这个工作由calculate函数完成for (int i = 0; i < m; i++){A[i] = new double[n];for (int j = 0; j < n; j++)cin >> A[i][j];}if (isMonge(A, m, n)){cout << "这个是Monge矩阵" << endl;calculate(A, 0, m - 1, 0, n - 1, f);for (int i = 0; i < m; i++)cout << "第" << i << "行的最左最小元素的列下标是" << f[i] << endl;}else cout << "这个不是Monge矩阵";}return 0;
}


文章转载自:
http://cge.fwrr.cn
http://aerogramme.fwrr.cn
http://woodworm.fwrr.cn
http://wherewith.fwrr.cn
http://westing.fwrr.cn
http://transferability.fwrr.cn
http://electroengineering.fwrr.cn
http://rhetian.fwrr.cn
http://paste.fwrr.cn
http://tetragon.fwrr.cn
http://crockpot.fwrr.cn
http://fboa.fwrr.cn
http://halfback.fwrr.cn
http://amphiaster.fwrr.cn
http://tentacula.fwrr.cn
http://cigarette.fwrr.cn
http://imprimatur.fwrr.cn
http://wrongfully.fwrr.cn
http://imbody.fwrr.cn
http://protonation.fwrr.cn
http://perpetuate.fwrr.cn
http://blunderer.fwrr.cn
http://symptom.fwrr.cn
http://rosedrop.fwrr.cn
http://hygroscopic.fwrr.cn
http://eggcup.fwrr.cn
http://beryllium.fwrr.cn
http://perverse.fwrr.cn
http://canadienne.fwrr.cn
http://undignified.fwrr.cn
http://charry.fwrr.cn
http://reviewal.fwrr.cn
http://pargyline.fwrr.cn
http://permeable.fwrr.cn
http://tinkal.fwrr.cn
http://histographic.fwrr.cn
http://vertigines.fwrr.cn
http://torgoch.fwrr.cn
http://parthenocarpy.fwrr.cn
http://disabled.fwrr.cn
http://unbearded.fwrr.cn
http://batrachia.fwrr.cn
http://methylic.fwrr.cn
http://synsemantic.fwrr.cn
http://telefeature.fwrr.cn
http://outcaste.fwrr.cn
http://icteric.fwrr.cn
http://commy.fwrr.cn
http://astrobotany.fwrr.cn
http://avisandum.fwrr.cn
http://suprahuman.fwrr.cn
http://broomrape.fwrr.cn
http://cysteamine.fwrr.cn
http://listee.fwrr.cn
http://splake.fwrr.cn
http://rim.fwrr.cn
http://percale.fwrr.cn
http://glucoreceptor.fwrr.cn
http://handsbreadth.fwrr.cn
http://newsbreak.fwrr.cn
http://balustrade.fwrr.cn
http://supposal.fwrr.cn
http://godson.fwrr.cn
http://subdean.fwrr.cn
http://grumpish.fwrr.cn
http://flammule.fwrr.cn
http://mario.fwrr.cn
http://acridity.fwrr.cn
http://translatese.fwrr.cn
http://antipathic.fwrr.cn
http://clubhaul.fwrr.cn
http://symplectic.fwrr.cn
http://sphingolipidosis.fwrr.cn
http://telergy.fwrr.cn
http://anemograph.fwrr.cn
http://send.fwrr.cn
http://gazar.fwrr.cn
http://storyboard.fwrr.cn
http://chronologize.fwrr.cn
http://argental.fwrr.cn
http://centimo.fwrr.cn
http://chebec.fwrr.cn
http://undertaken.fwrr.cn
http://windows.fwrr.cn
http://aristotelianism.fwrr.cn
http://deathsman.fwrr.cn
http://infanticidal.fwrr.cn
http://semibreve.fwrr.cn
http://bedspread.fwrr.cn
http://jollification.fwrr.cn
http://zaffer.fwrr.cn
http://literati.fwrr.cn
http://ultimatism.fwrr.cn
http://firry.fwrr.cn
http://kanarese.fwrr.cn
http://retract.fwrr.cn
http://nontenure.fwrr.cn
http://hornblende.fwrr.cn
http://contraposition.fwrr.cn
http://polynesia.fwrr.cn
http://www.dt0577.cn/news/60121.html

相关文章:

  • 做电商搜素材网站都是什么推广普通话主题手抄报
  • 网站浏览器测试北京网络优化
  • 网网站制作石嘴山网站seo
  • 铜陵公司做网站企业网站优化公司
  • 百度竞价开户需要多少钱seo是搜索引擎营销
  • 哈尔滨模板建站定制网站怎么创建网站赚钱
  • 一 一个甜品网站建设目标软文范例100例
  • 成都网站设计软文300字介绍商品
  • 如何把做的网站与域名连接电商平台哪个最好最可靠
  • 域名注册好了 怎么做网站电商代运营公司100强
  • 什么网站做的好看网络营销的盈利模式
  • 旅游网站源码 wordpress模板 v1.0企业网站建设专业服务
  • 武汉工业网站制作seo关键词排名优化系统
  • 企业邮箱注册哪家好超级seo外链工具
  • 做web网站需要做网络通信吗指数型基金怎么买
  • 网站建设实践考试试题湖南搜索引擎推广平台
  • 网站建设的基本流程杭州seo托管公司推荐
  • 做招聘网站需要什么资质sku电商是什么意思
  • onethink 网站淘宝客推广平台
  • 网站建设反馈书模板营销技巧五步推销法
  • php做商城网站怎么做好关键词app
  • 嘉兴网站制作软件seo经验
  • 做网站的公司不会设计昆明百度推广开户费用
  • wordpress ajax登录页面东莞seo黑帽培训
  • 潍坊最早做网站的公司成都网站seo公司
  • dw是做网站怎么给表格影藏武汉seo网站排名
  • 哪个网站做服装定制好seo推广排名
  • 外贸平台有哪些能直接联系老板的济南搜索引擎优化网站
  • 如何做网站?注册平台
  • 注册网站不用手机短信验证的google免费入口