HBC51155箱子归位,过关题目,语言题I-country题解

北笙凉宸 算法基础篇 38 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
在N×MNtimes MN×M 的矩阵中,每个格子有一个权值,要求寻找一个包含 K 个格子的凸连通块(连通块中间没有空缺,并且轮廓是凸的,如书中图片所示),使这个连通块中的格子的权值和最大,求出这个最大的权值和,并给出连通块的具体方案,本题有SPJ,输出任意一种方案即可,N,M≤15,K≤225N,M leq 15,K leq 225N,M≤15,K≤225, According to top-s

在N×MNtimes MN×M 的矩阵中,每个格子有一个权值,要求寻找一个包含 K 个格子的凸连通块(连通块中间没有空缺,并且轮廓是凸的,如书中图片所示),使这个连通块中的格子的权值和最大。求出这个最大的权值和,并给出连通块的具体方案。本题有SPJ,输出任意一种方案即可。N,M≤15,K≤225N,M leq 15,K leq 225N,M≤15,K≤225。 According to top-secret A-country plans, I-country is divided into N×MN times MN×Mequal squares, each square contains some oil resources. They want to occupy all the territory of I-country, but the UN (United Nations) will allow them to occupy only K squares. Of course, A-country want to get control over as many oil as possible, but, they will have to guard all their territory. So, they need their territory to be easy-controlled, i.e. from any square to any it must be possible to get moving only along two directions (selected from the next list: left, right, up, down; for different squares pairs of directions may differ). You are to write a program, which determinies, what squares will be occupyed by A-country. If there are several solutions, you may output any.

HBC51155箱子归位,过关题目,语言题I-country题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC51155箱子归位 过关题目 语言题I-country题解