HBC51282[USACOJan2020S]LoanRepaymentK取方格数题解

为你而来永不停止 算法基础篇 47 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
On anN×Nchessboard with a non-negative number in each grid, Kaka starts his matrix travels withSUM= 0. For each travel, Kaka moves one rook from the left-upper grid to the right-bottom one, taking care that the rook moves only to the right or down. Kaka adds the number toSUMin each grid the rook visited, and replaces it with zero. It is not difficult to know the maximumSUMKaka can obtain for his first travel. Now Kaka is wondering what is the maximumSUMhe can obtain after hisKth travel. Note theSUMis accumulative during theKtravels.

On an N × N chessboard with a non-negative number in each grid, Kaka starts his matrix travels with SUM = 0. For each travel, Kaka moves one rook from the left-upper grid to the right-bottom one, taking care that the rook moves only to the right or down. Kaka adds the number to SUM in each grid the rook visited, and replaces it with zero. It is not difficult to know the maximum SUM Kaka can obtain for his first travel. Now Kaka is wondering what is the maximum SUM he can obtain after his Kth travel. Note the SUM is accumulative during the K travels.

HBC51282[USACOJan2020S]LoanRepaymentK取方格数题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC51282[USACOJan2020S]LoanRepaymentK取方格数题解