Pro.ID22114 TitleJob Assignment Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22114 AC0 Submit0 Ratio- 时间&空间限制描述One problem comes up when we are trying to assign jobs about GDCPC’2003 (ZSUCPC’2003) to staffs. Because some of them complain that the tasks assigned to them are so bother. This emotion will lead to very bad effect in sequence. So we try to satisfy every staff as possible as we can. At first, we make an investigation to get the information about staffs’ attitude towards every task. And then we evaluate each attitude as a point (a positive integer number not larger than 100). The higher the point is, the more the staff is satisfied. Because the staffs are very busy, they have only a little leisure time to finish the task. So we just assign one task to one person, of course, one task can not be assigned to different persons. Now we give you all the points and hope you can help us to assign the tasks to make the sum of the points which correspond the assignment is maximum. 输入Input will contain several test cases. The first line of each test case only contains one integer number N (0 <= N <= 100). N is the number of staffs, also is the number of tasks. And then, the following N lines describe staffs’ attitude. Each line contains n positive integer numbers. The j-th number in the i-th line describes i-th staff's attitude to the j-th task. N=0 indicates the end of input file. 输出Description One problem comes up when we are trying to assign jobs about GDCPC’2003 (ZSUCPC’2003) to staffs. Because some of them complain that the tasks assigned to them are so bother. This emotion will lead to very bad effect in sequence. So we try to satisfy every staff as possible as we can. At first, we make an investigation to get the information about staffs’ attitude towards every task. And then we evaluate each attitude as a point (a positive integer number not larger than 100). The higher the point is, the more the staff is satisfied. Because the staffs are very busy, they have only a little leisure time to finish the task. So we just assign one task to one person, of course, one task can not be assigned to different persons. Now we give you all the points and hope you can help us to assign the tasks to make the sum of the points which correspond the assignment is maximum. Input Input will contain several test cases. The first line of each test case only contains one integer number N (0 <= N <= 100). N is the number of staffs, also is the number of tasks. And then, the following N lines describe staffs’ attitude. Each line contains n positive integer numbers. The j-th number in the i-th line describes i-th staff's attitude to the j-th task. N=0 indicates the end of input file. Output For each test case you should output one line, and just one number in this line. The number is the maximum. Sample Input 2
10 90
80 100
3
50 60 70
70 75 80
80 90 100
0 Sample Output 170
230 Source 样例输入2
10 90
80 100
3
50 60 70
70 75 80
80 90 100
0 样例输出170
230 作者 |