#P12827. 「DLESS-2」XOR and Even
「DLESS-2」XOR and Even
Description
You are given a sequence of non-negative integers. You need to process queries, each being one of the following two types:
0 l r x: Count the number of ways to select an even number of elements from the range (inclusive) such that their XOR sum is less than or equal to . Selecting zero elements is allowed, and their XOR sum is . Output the count modulo .1 l r x: Select an even number of elements from the range (inclusive). Let their XOR sum be . Find the maximum possible value of .
Input Format
This problem contains multiple test cases. The first line contains an integer , the number of test cases.
For each test case: The first line contains two integers, and . The second line contains integers, representing the sequence . Each of the next lines describes a query in the format specified in the problem description.
Output Format
For each query, output a single integer on one line, representing the answer.
2
5 6
1 2 4 8 16
0 1 3 3
0 1 4 3
1 2 4 0
1 2 4 1
0 1 5 114514
0 1 4 5
6 7
1 1 4 5 1 4
0 1 3 0
1 2 4 0
1 1 2 1
1 2 6 0
1 1 4 5
0 2 4 4
1 1 2 0
2
2
12
13
16
3
2
5
1
5
5
3
0
Hint
For all test cases, it is guaranteed that:
This problem uses subtasks for scoring (bundled testing). The descriptions of the subtasks are as follows:
| Subtask | Special Property | Score | ||
|---|---|---|---|---|
| None | ||||
| A | ||||
| B | ||||
| None | ||||
| A | ||||
| B | ||||
| None | ||||
Special Property A: All queries are of type 0.
Special Property B: All queries are of type 1.
京公网安备 11011102002149号