Problems > The Fairest Cut > Editorial

The Fairest Cut — Solution & Editorial

Back to the Problem

Subset-sum reachability up to total/2 (bitset DP); the closest reachable sum to half gives difference total − 2·best.

Complexity: O(N · sum / 64) with bitsets