当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5569:matrix

题目描述
Given a matrix with $n$ rows and $m$ columns ( $n+m$ is an odd number ), at first , you begin with the number at top-left corner (1,1) and you want to go to the number at bottom-right corner (n,m). And you must go right or go down every steps. Let the numbers you go through become an array $a_1, a_2, ... , a_{2k}$. The cost is $a_1*a_2+a_3*a_4+...+a_{2k-1}*a_{2k}$. What is the minimum of the cost?
输入解释
Several test cases(about $5$)

For each cases, first come 2 integers, $n,m(1 \leq n \leq 1000,1 \leq m \leq 1000)$

N+m is an odd number.

Then follows $n$ lines with $m$ numbers $a_i,j ( 1 \leq a_i \leq 100)$
输出解释
For each cases, please output an integer in a line as the answer.
输入样例
2 3
1 2 3
2 2 1
2 3
2 2 1
1 2 4
输出样例
4
8
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5569

最后修改于 2020-10-25T23:23:51+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 65536/65536K(Java/Others)