atcoder#ARC066B. [ABC050D] Xor Sum
[ABC050D] Xor Sum
Score : points
Problem Statement
You are given a positive integer . Find the number of the pairs of integers and such that there exist two non-negative integers and satisfying and . Here, denotes the bitwise exclusive OR. Since it can be extremely large, compute the answer modulo .
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print the number of the possible pairs of integers and , modulo .
3
5
The five possible pairs of and are:
- (Let , then , .)
- (Let , then , .)
- (Let , then , .)
- (Let , then , .)
- (Let , then , .)
1422
52277
1000000000000000000
787014179