Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя Tobby_And_Friends

Автор Tobby_And_Friends, история, 7 лет назад, По-английски

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.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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.