HBC15726F. Flower Road题解

人生如戏 算法基础篇 40 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
(受限于评测机,此题数据范围与现场赛不一致,请谅解) Once upon a time, there was a beautiful princess named TQM, and a handsome prince named GSS. One day, the prince would like to visit the princess. While in front of

(受限于评测机,此题数据范围与现场赛不一致,请谅解) Once upon a time, there was a beautiful princess named TQM, and a handsome prince named GSS. One day, the prince would like to visit the princess. While in front of the princess' house, there was a flower-beds with blooming flowers. The prince was supposed to go through the flower-beds choosing the best ``Flower Road''. Here is the task. The flower-beds is presented by a N×NNtimes NN×N matrix with integers on each grid representing the princess' satisfaction of the flowers on it. Now, the prince was on the top left point (1, 1) and the princess was on the bottom right point (N, N). While the princess didn't want this to be so easy, she operated M times ``rotation'' on the flower-beds according to the order. Each time, she would choose a 2Li×2Li2L_itimes 2L_i2Li​×2Li​ matrix whose top left point was (xi,yi)(x_i, y_i)(xi​,yi​). Then, four disjoint parts of the matrix whose length of size was LiL_iLi​ rotated clockwise. Here is an example to make the ``rotation'' clearly. Then, your task is to help the prince to choose a best ``Flower Road'' after these operations with the largest sum of the satisfaction. By the way, the prince will take the shortest way, which means he will only go down (from point (x, y) to point (x+1, y)) and right (from point (x, y) to point (x, y+1)).

HBC15726F. Flower Road题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC15726F. Flower Road题解