Exact Subset Sum — Solution & Editorial
Boolean knapsack: reachable[v] |= reachable[v − x] processing each item once (iterate v downward, or use a bitset shift — one machine word op per 64 sums).
Complexity: O(N·T / 64) with bitsets
Boolean knapsack: reachable[v] |= reachable[v − x] processing each item once (iterate v downward, or use a bitset shift — one machine word op per 64 sums).
Complexity: O(N·T / 64) with bitsets