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

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

In this spoj problem https://www.spoj.com/HSPLARCH/problems/HS08AKP/ constraints are bigger i.e., we cannot use 2D Knapsack so how else can we print the solutions in space optimized knapsack? Help would be greatly appreciated... :)

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

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

Still waiting for someone to answer... :(

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

let f[I] mean the best value with a total weight I. We can maintain g[I] which means the origin of f[I], so that i — g[I] is the weight of current item and f[I] — f[g[I]] is the value. Then let I become j, and do so.

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