White RoomNEW

Forty Items Two Halves

You have 40 weights and a target sum, and you must decide whether some subset hits the target exactly. Enumerating all subsets is 2401.1010122^{40} \approx 1.10 \cdot 10^{12}, far too slow.

You split the 40 into two halves of 20, enumerate all 220=10485762^{20} = 1,048,576 subset sums of each half, sort the left list, and for every right-half sum binary search the left list for the complement.

Roughly how many elementary operations does that plan cost?