HBC252112四季,语言题Maximum Energy题解

2拍不死你 算法基础篇 40 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
m columns. Each cell on the grid has a height with the height of cell. . Christina does not know which cell she started in, but she does know one thing: she is very small, especially when it comes to climbing mountains. Therefore, she can only move to a cell that is no higher than the one she is currently on and that is adjacent to her current cell. When Christina moves between two cells of the same height, she expends no energy. Otherwise, each move she makes expends. Now Christina wants to know, for all possible starting positions, what is the maximum energy she would expend?Two cells are considered adjacent if they share an edge.

Christina finds herself on a grid with n n rows and m m columns. Each cell on the grid has a height with the height of cell (i,j) (i,j) being h_{i,j} h i,j ​ . Christina does not know which cell she started in, but she does know one thing: she is very small, especially when it comes to climbing mountains. Therefore, she can only move to a cell that is no higher than the one she is currently on and that is adjacent to her current cell. When Christina moves between two cells of the same height, she expends no energy. Otherwise, each move she makes expends 1 1 unit of energy. Now Christina wants to know, for all possible starting positions, what is the maximum energy she would expend? Two cells are considered adjacent if they share an edge. Note: Christina must never be allowed to move off the grid at any time.

HBC252112四季,语言题Maximum Energy题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC252112四季 语言题Maximum Energy题解