atcoder#ABC278H. [ABC278Ex] make 1
[ABC278Ex] make 1
Score : points
Problem Statement
A sequence of non-negative integers is said to be a good sequence if:
- there exists a non-empty (not necessarily contiguous) subsequence of such that the bitwise XOR of all elements in is .
There are an empty sequence , and cards with each of the integers between and written on them. You repeat the following operation until becomes a good sequence:
- You freely choose a card and append the integer written on it to the tail of . Then, you eat the card. (Once eaten, the card cannot be chosen anymore.)
How many sequences of length can be the final after the operations? Find the count modulo .
What is bitwise XOR?
The bitwise \mathrm{XOR} of non-negative integers A and B, A \oplus B, is defined as follows.- When A \oplus B is written in binary, the k-th lowest bit (k \geq 0) is 1 if exactly one of the k-th lowest bits of A and B is 1, and 0 otherwise.
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
2 2
5
The following five sequences of length can be the final after the operations.
2022 1119
293184537
200000 10000000
383948354