Power of 2
CodeChefOpen on judge ↗
Chef likes problems involving arrays . Unfortunately the last one he tried to solve didn't quite get solved. Chef has an array , $A$ of $N$ positive integers.He wants to find an array, $B$ such that for each $i$ (0 to N-1), $Bi=X$ where $X$ is the smallest number to be subtracted from $Ai$ to express it as a power of 2. Help the chef to find array ,$B$ for a given array ,$A$ ### Input - First
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