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

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

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
  • Проголосовать: не нравится

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

Still waiting for someone to answer... :(

»
5 лет назад, # |
  Проголосовать: нравится 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.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Oh I submitted your idea ... it got an ac on 2nd try... Thanks But i think the test cases are weak tooo...

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Hy..ik it's been too long but by any chance can you share the source code ?!

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