Please read the new rule regarding the restriction on the use of AI tools. ×

Master_coder's blog

By Master_coder, history, 6 years ago, In English

i want to know how to optimize classic 0/1 knapsack to 0/k knapsack . the problem link is https://open.kattis.com/problems/thief

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    still this solution not work it exceed time limit . we can do this in O(knapsack_size*num_of_items) i am getting how to do this so can any body help me ??

»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

I don't think that this question simply asks for 0/k knapsack (or bounded knapsack, the popular name). You can check here and here for a better explanation.