Is this variant of the subset sum problem easier to solve?

后端 未结 8 824
旧巷少年郎
旧巷少年郎 2020-12-08 23:18

I have a problem related to the subset sum problem and am wondering if the differences make it easier, i.e. solvable in a reasonable amount of time.

Given a value V,

8条回答
  •  [愿得一人]
    2020-12-09 00:13

    If it's only positive integers, you can do a verification step if you need;

    Take the sum of the L-1 smallest integers in the set. If that's a sum X, then n-X must be below the largest element if the problem is supposed to have a solution. Come to think of it, you can eliminate other L this way...

提交回复
热议问题