1. 程式人生 > >動態規劃:HDU1712-ACboy needs your help(分組揹包問題)

動態規劃:HDU1712-ACboy needs your help(分組揹包問題)

The input consists of multiple data sets. A data set starts with a line containing two positive integers N and M, N is the number of courses, M is the days ACboy has. Next follow a matrix A[i][j], (1<=i<=N<=100,1<=j<=M<=100).A[i][j] indicates if ACboy spend j days on ith course he will get profit of value A[i][j]. N = 0 and M = 0 ends the input.