Special Subset Sums: Optimum (103)
In Problem 103, we're asked to find a an optimal special sum set (SSS).
I use the pivot element construction to find an SSS with given size
Then I do a depth-first search. I start a set with
The insights are really only the quick checks to discard all sets that cannot turn out size-monotone or sum-distinct.
This takes 9 s to compute and hence doesn't feel like the right approach here. In the forums, I couldn't find a more clever way to do it. With AI, I couldn't find a more clever way either. Perhaps that is really all to it.