Problems > Two Equal Piles > Editorial

Two Equal Piles — Solution & Editorial

Back to the Problem

The total must be even, and then it reduces to subset-sum for total/2 — same bitset DP.

Complexity: O(N·sum / 64)