C. 矩阵取数

    Type: Default 2000ms 512MiB

矩阵取数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

有一个 n×nn\times n 的矩阵,矩阵中的每个数都是整数。

现在要从矩阵中取 mm 个数,要求每一行最多取一个数,每一列也最多取一个数。

mm 个数的和最大能是多少?

输入格式

第一行两个数 nnmm

接下来 nn 行,每行 nn 个数,表示矩阵。

输出格式

一行一个数,表示选择的 mm 个数的和最大是多少。

样例输入

3 2
1 2 3
4 5 6
7 8 7

样例输出

14

数据规模

50%50\%的数据,1mn31\leq m\leq n\leq 3

100%100\%的数据,1m3,mn151\leq m\leq 3, m\leq n\leq 15

矩阵中的数是不超过10510^5的正整数。

CSP-J模拟8

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2024-8-10 9:00
End at
2024-8-10 12:00
Duration
3 hour(s)
Host
Partic.
7