#P5610. [Ynoi2013] 大学
[Ynoi2013] 大学
Problem Description
Given a non-negative integer sequence of length , support the following two operations:
1 l r x: For all numbers in the interval that are multiples of , divide them by .2 l r: Query the sum of the interval .
This problem is forced online. For each operation, the values need to be XORed with the previous answer. If there has been no previous query, then the previous answer is .
Input Format
The first line contains two integers .
The second line contains non-negative integers representing .
Then follow lines, each describing one operation.
1 l r x: For all numbers in the interval that are multiples of , divide them by .2 l r: Query the sum of the interval .
Output Format
For each query, output one integer per line as the answer.
5 2
1 2 3 4 5
1 1 5 2
2 1 5
12
Hint
Constraints: , . The decrypted satisfy , .
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, mrsrz, Data: nzhtl1477, mrsrz, 一只绝帆.
Translated by ChatGPT 5