PatreonOA #1
Minimize Computation Time
Estimated MediumJudge-ready
Topics (AI-labelled)HashingBits & Math
In one operation, all values currently equal to some even number c are halved at the same time. Find the minimum number of operations needed to make every value odd.
The standard input/output conventions and constraints added by this site are described under "Input".
Input
n≤200000, positive integer values ≤10^9 (added by this site).
Output
Output the number of operations.
Example 1
Input:
4
2 4 8 16
Output:
4
Example 2
Input:
3
3 5 7
Output:
0
Example 3
Input:
4
2 2 4 4
Output:
2
Example 4
Input:
3
6 12 3
Output:
2
Editorial
Loading solution…