CSES PROBLEM:Book Shops II. Help needed

Revision en1, by Sumanto, 2020-06-27 09:18:26

https://cses.fi/problemset/task/1159/

In this problem I used 0-1 knapsack to solve but got time limit exceeded. My approach to handle copies was to make duplicates of those items and apply knapsack. But it failed to pass few of the test cases(TLE). Any help will be appreciated.

My Code

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sumanto 2020-06-27 09:18:26 1380 Initial revision (published)