Tobby_And_Friends's blog

By Tobby_And_Friends, history, 7 years ago, In English

Problem Link: http://lightoj.com/volume_showproblem.php?problem=1180&language=english&type=pdf

I have read in a blog that this particular problem involves dynamic programming with binary search. Someone kind enough please provide me an explanation on how to solve this problem using the mentioned topics.

»
7 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I think this should work: let's say you use binary search on the answer; when you have time limit fixed, you are able to know how many subprojects of type A and B the i-th programmer can solve. Then, with the time fixed, you do dp[i][j] — the maximum number of subprojects of type B that can be solved considering the programmers from 1 to i and having solved j subprojects of type A; if dp[n][m] >= m, then it means the fixed time is valid and otherwise it isn't.