atcoder#ARC139F. [ARC139F] Many Xor Optimization Problems
[ARC139F] Many Xor Optimization Problems
Score : points
Problem Statement
PCT made the following problem.
Xor Optimization ProblemYou are given a sequence of non-negative integers of length : . When it is allowed to choose any number of elements in , what is the maximum possible of the chosen values?
Nyaan thought it was too easy and revised it to the following.
Many Xor Optimization ProblemsThere are sequences of length consisting of integers between and . Find the sum, modulo , of the answers to Xor Optimization Problem for all those sequences.
Solve Many Xor Optimization Problems.
What is bitwise $\mathrm{XOR}$?
The bitwise of non-negative integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if exactly one of and is , and otherwise.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
2 1
3
We are to solve Xor Optimization Problem for all sequences of length consisting of integers between and .
- The answer for is .
- The answer for is .
- The answer for is .
- The answer for is .
Thus, the final answer is .
3 4
52290
1234 5678
495502261