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

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

I just solved this problem in uva.onlignejudge 10664 a classical dp problem ( you have n weights and you want to find a way to distribute these weights equally between 2 people ) so you only need a simple dp to find (total sum of weights ) / 2 using given weights .

but what if we decided to shares these weight between k people how to solve that ? do we have to keep track on the chosen weights ??

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

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Solved the problem : http://lightoj.com/volume_showproblem.php?problem=1147 The problem is almost similar to your question . Thanks .

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

You can do brute-force for O(kn) or dp for O(k^{2}*MAXSUM^{k — 1}).

I dont think it's possible to solve it faster.