#P5066. [Ynoi Easy Round 2014] 人人本着正义之名
[Ynoi Easy Round 2014] 人人本着正义之名
Description
You need to help Chtholly maintain a 01 sequence of length . There are operations:
1 l r: Set all numbers in interval to .2 l r: Set all numbers in interval to .3 l r: For all in , change it to the bitwise OR of and . These changes are performed simultaneously.4 l r: For all in , change it to the bitwise OR of and . These changes are performed simultaneously.5 l r: For all in , change it to the bitwise AND of and . These changes are performed simultaneously.6 l r: For all in , change it to the bitwise AND of and . These changes are performed simultaneously.7 l r: Query the sum over interval .
This problem is forced online. Each needs to be XORed with the previous answer using . If there has been no query before, then the previous answer is .
Input Format
The first line contains two integers and .
The second line contains integers representing the sequence .
Then follow lines, each containing three integers , indicating which operation it is and the interval it applies to.
Output Format
For each query operation, output one line with one number as the answer.
5 5
0 1 0 0 1
3 2 5
5 2 5
2 2 2
6 1 5
7 1 5
1
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477.
The sequence after each step:
For of the testdata, .
For of the testdata, .
For another of the testdata, both the operations and the sequence are generated randomly.
For another of the testdata, .
Constraints: for of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号