atcoder#ARC139A. [ARC139A] Trailing Zeros
[ARC139A] Trailing Zeros
Score : points
Problem Statement
For a positive integer , let be the number of trailing zeros in the binary representation of .
For example, we have because the binary representation of is 1000
, and because the binary representation of is 101
.
You are given a sequence of non-negative integers . Consider making a sequence of positive integers of your choice so that it satisfies the following conditions.
- holds. In other words, is strictly increasing.
- holds for every integer such that .
What is the minimum possible value of here?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
4
0 1 3 2
12
For example, satisfy the conditions. cannot be or less, so the answer is .
5
4 3 2 1 0
31
1
40
1099511627776
Note that the answer may not fit into a -bit integer.
8
2 0 2 2 0 4 2 4
80