BestCoder Round #63 (div.1) B.matrix
来源:互联网 发布:mac输入法记忆 编辑:程序博客网 时间:2024/05/17 22:05
matrix
Accepts: 124
Submissions: 171
Time Limit: 6000/3000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
问题描述
给定n∗m(n+m为奇数)的矩阵,从(1,1)走到(n,m)且只能往右往下走,设经过的数为a1,a2...a2k,贡献为a1∗a2+a3∗a4+...+a2k−1∗a2k,求最小贡献。
输入描述
若干组数据(大概5组)。每组数据第一行两个数n,m(1≤n,m≤1000且n+m为奇数)。接下来n行每行m个数ai,j(1≤ai,j≤100)描述这个矩阵。
输出描述
对于每组数据,输出一行表示答案。
输入样例
2 31 2 32 2 12 32 2 11 2 4
输出样例
48
求这种题马上想到dp。
我用的是记忆化搜索。
重(1, 1)到(n, m)的最小贡献度
(n, m)只能从(n-1, m)和(n, m-1)来
我们就可以用这种思想求
0 0
- BestCoder Round #63 (div.1) B.matrix
- BestCoder Round #63 (div.2)1003matrix
- BestCoder Round #81 (div.1) A Matrix
- BestCoder Round #64 (div.1) B.Array
- BestCoder Round #81 (div.1) B String
- HDU 5569 matrix(DP)——BestCoder Round #63(div.1 div.2)
- BestCoder Round #63 (div.2) HDOJ5569 matrix(dp)
- BestCoder Round #68 (div.1) B 矩阵乘法优化DP
- BestCoder Round #81 (div.1) A B hdu5571 hdu 5572
- 【BestCoder Round #59 (div.1) B】【疯狂的火神】
- (BestCoder Round #59 (div.1) B)简单DP
- 【BestCoder Round #59 (div.1) B】疯狂的火神
- 【BestCoder Round #59 (div.1) B】【JZOJ4693】疯狂的火神
- BestCoder Round #63 (div.1) A.sequence2
- BestCoder Round #78 (div.2) A B
- BestCoder Round #82 (div.2) A B
- HDU 5671 Matrix——BestCoder Round #81(div.1 div.2)
- BestCoder Round #63 (div.2)
- 理解 JavaScript 的作用域链
- 图算法:1、邻接表实现图的深度优先遍历,广度优先遍历
- GSM/GPRS/EGPRS相关调制方式/速率
- iOS开发实战tips--断点可以这样玩(debug)
- web项目快速代码生成器rapid-framework
- BestCoder Round #63 (div.1) B.matrix
- 获取嵌入ActiveX控件的页面IWebBrowser2指针
- 在Jquery实现Ajax和JS实现Ajax的方法
- 杭电ACM1164
- JavaScript 之事件处理详解
- HDU-5568 sequence2(DP+高精度)
- (一)Unix、Linux以及GNU
- Spark Streaming大规模流式处理
- Chrome postman插件用来测试http 接口