编程介的小学生 2017-02-13 10:00 采纳率: 20.5%
浏览 842
已采纳

The Delivery of Control

Description
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.
Input
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.
Output
One line contains the maximum sum.
Sample Input
4 4 10
-1 2 1 1
2 -1 0 2
3 1 -1 1
2 2 1 -1
Sample Output
10

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-02-13 10:10
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误