Split Powers Of 2
Suppose that you have several powers of two, specifically, you have $A_i$ numbers equal to $2^i$ for each $1 \le i \le N$. You want to divide **all** of these numbers into two groups with equal sum. However, it's not always possible. To make it possible, in one operation you are allowed to choose any $1 \le i \le N$ and receive an extra number $2^i$ (in other words, you can increase any $A_i$ by
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start