题目链接:点击打开链接 Description 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
题目 跑 k k k遍方格取数,问能取到的最大价值 分析 按照算法竞赛进阶指南,建边应该是拆点后入点连接出点用两条边,一条容量为1,费用为 a i , j a_{i,j} ai,j,另一条容量为 k − 1 k-1 k−1,费用为0,向右向下的有向边容量为 k k k,费用为0,从 ( 1 , 1 ) (1,1) (1,1)入点开始跑到 ( n , n ) (n,n) (n,n)的出点