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

建议使用的浏览器:

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

3075:Mystery ET

题目描述
In the year 3890, we ALPCs find that the army of another planet is going to attack the earth, and we have to stop this attack to save our human beings, save the earth.
ALPC2587 has captured an ET, and he starts research this ET. Several days later he draws a conclusion that an ET’s living on the earth depends on a parameter named DR. DR measures the dangerousness of an ET. If an ET has a larger DR, it’s more dangerous. Now ALPCs have to find the maximum value of DR.
But there’s a problem that ET keeps growing: in an experience, first of all, we randomly put a cell of an ET in to box with N*N grids, every grid has a value, which is the value of DR (may be negative) of that grid. Then the cell grows freely and then constructs a creature. The creature’s DR is the total DR of all the girds it captured. In a unit time, the creature can choose one of its cell (grid) to grow to a adjacent grid.
Here’s an example:

ALPC2587 has experienced a lot but he is not clever enough to calculate the maximum DR, and all other ALPCs are busy with other tasks, so he comes to you for help. Please help him to calculate the maximum DR value the creature can gain in an experience.
输入解释
  There are multiple test cases, please process to the end of file.
  In each the first line contains N (N<=9), the size of the box. Then comes N lines, each has N integers Aij (|Aij| < 32768), indicates the DR value of each grid.
输出解释
For each case output the maximum DR value the creature can be.
输入样例
4
2 -1 -1 -1
5 -5 -1 -5
3  2 -1  3
2 -2 -3  2
输出样例
18
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-3075

最后修改于 2020-10-25T22:59:47+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
60000/30000MS(Java/Others) 32768/32768K(Java/Others)