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

建议使用的浏览器:

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

3574:Cube Min Surface Carving

题目描述
Given a cube with size x*y*z. each vertex has a non-negative weight w(x, y, z). As shown in figure 1, a surface-carving is a curved section on the XOY plane, and it has two properties:

Figure 1. The cube and the surface-carving example

  1. Surface F is formed of x*y vertices, and there is one and only one vertex in each Z axis belonging to the surface.
  2. For each vertex (x, y, z) on the surface,its XOY plane adjacent vertices(x+1, y, z’) or (x-1, y, z’) or (x, y+1, z’) or (x, y-1, z’) satisfy that |z- z’|<=1.
  Define the energy of the surface F as the sum of the vertices value on it.
  Please obtain the minimum value of the surface energy.
输入解释
There are multiple test cases. first line input the number of the test case. The number of cases is less than 20.
  For each test case, the first line contains three integers x, y and z(1<=x, y, z<=10), denoting the size of the cube.
  The next x*y*z integers, denoting the weight of each vertex(x, y, z), ordered by the axis X, Y, Z. (eg. w(0,0,0), w(1,0,0), … w(0, 1, 0), … w(0, 0, 1)…w(x,y,z)).
输出解释
For each test case, output the energy value of the Min-Surface-Carving as format shown at sample output.
输入样例
2

2 2 2
0 5
6 3
4 1
2 7

2 1 5
4 1
4 2
2 3
4 4
4 5
输出样例
Case 1: 6
Case 2: 4
来自杭电HDUOJ的附加信息
Author hh314
Recommend zhouzeyong

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

源链接: HDU-3574

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

共提交 0

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