100 atcoder#ABC129E. [ABC129E] Sum Equals Xor
[ABC129E] Sum Equals Xor
Score : points
Problem Statement
You are given a positive integer in base two. How many pairs of non-negative integers satisfy the following conditions?
Since there can be extremely many such pairs, print the count modulo .
What is XOR?
The XOR of integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if either or , but not both, has in the 's place, and otherwise.
For example, . (In base two: .)
Constraints
- is given in base two, without leading zeros.
Input
Input is given from Standard Input in the following format:
Output
Print the number of pairs that satisfy the conditions, modulo .
10
5
Five pairs satisfy the conditions: and .
1111111111111111111
162261460