Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Interesting constructive solution. 

My first reaction was 0-1 Knapsack and I believe it'll work. But you don't have to use it. 

Think about the min sum & max sum you can collect with exactly K boxes. Then? from min-sum, and move boxs 'right-ward' until to the target sum.

posted on 2018-01-27 06:25  Tonix  阅读(149)  评论(0编辑  收藏  举报