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

建议使用的浏览器:

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

3679:The Delivery of Control

题目描述

The Gugoo Gang controls an area of N × M blocks in a city. To award Tom for his contribution to the Gugoo, the Boss decides to turn over part of the area under his control to Tom. The delivery is done according to the Gang's old tradition.

Tom is asked to start a trip at a cross in the city, take a ride along the streets, and finally get back to his start point within T minutes. In every minute Tom may move from one cross to an adjacent one. The blocks enclosed by his route are delivered to him. During the trip, Tom is not allowed to come back to a cross which he has already visited except the start point and once he reaches the start point his trip ends. If Tom fails to get back in time, he won't get any block. And he can not give up any blocks that is enclosed by his route.

As an environment protectionist, Tom assigns a satisfaction value to each block according to its greenness. He wants to maximize the sum of satisfaction values of his blocks.

输入解释

The first line contains three integers, N, M and T (1 ≤ N, M, T ≤ 20).
N × M integers follow which describe the satisfaction values of every block.

输出解释

One line contains the maximum sum.

输入样例
4 4 10
-1 2 1 1
2 -1 0 2
3 1 -1 1
2 2 1 -1
输出样例
10
来自北京大学POJ的附加信息
Case time limit(单组数据时间限制) 3000MS

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3679

最后修改于 2020-10-29T07:08:00+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000 65536