HDU 1158 - Employment Planning
Problem : A manager can employ/fire a employee at the beginning of a month with cost a/c. An employee works for a month will cost manager b. Each month need a specific number of the employee. At the start, there is no employee. How to hire the employee can make the cost minimum.
Solution : Let f[i][j] to be that at the i-th end of the month, there are req[j] (The least requirement of j-th month) employee in the company, and the minimum cost of this status. Then f[i][j] = max{ f[i-1][k]+cost(from req[k] to req[j]) | req[k]>=req[i-1] }. (j should at least req[i], otherwise f[i][j]=inf).
Merge branch 'master' of github.com:MissAmour/KrwlngsACMFile