atcoder#DIVERTA2019E. XOR Partitioning
XOR Partitioning
Score : points
Problem Statement
The beauty of a sequence of length is defined as , where denotes the bitwise exclusive or (XOR).
You are given a sequence of length . Snuke will insert zero or more partitions in to divide it into some number of non-empty contiguous subsequences.
There are possible ways to insert partitions. How many of them divide into sequences whose beauties are all equal? Find this count modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3
1 2 3
3
Four ways of dividing shown below satisfy the condition. The condition is not satisfied only if is divided into .
3
1 2 2
1
32
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
147483634
Find the count modulo .
24
1 2 5 3 3 6 1 1 8 8 0 3 3 4 6 6 4 0 7 2 5 4 6 2
292