#P17286. 「IXOI R2」Horizon Blue
「IXOI R2」Horizon Blue
Background

(The picture is from the Phigros song artwork. Please contact to remove if infringement.)
Problem Description
You are given a sequence of length , and operations. You must process the following two types of operations in a forced online manner.
1 x y: increase the -th number in the sequence by .2 l r: compute the sum of the maximum values of all non-empty contiguous subsegments within the interval , and output the result modulo .
It is guaranteed that all numbers in the sequence are pairwise distinct at any time.
Input Format
The first line contains two integers .
The second line contains integers , representing the initial sequence.
The next lines each follow one of the two formats:
1 x y.2 l r.
Let last be the actual output of the previous query. Initially, last = 0. All XOR operations are performed on unsigned 32-bit integers.
-
For an input operation
1 x y, the actual modified position isThe parameter is not XORed.
-
For an input operation
$$[l_{\mathrm{real}},r_{\mathrm{real}}] =[l\oplus \mathrm{last},\ r\oplus \mathrm{last}].$$2 l r, the actual queried interval is -
Let the true answer of this query be . Output
and set
It is guaranteed that all operations are valid after decoding.
Output Format
For each operation of type 2, output one integer per line, representing the answer modulo .
10 10
305 6197 2133 7051 30 8411 2622 2173 8522 2998
1 2 5734
2 2 10
1 368406 9714
2 368402 368407
1 64015 4680
2 64015 64003
1 152896 5381
1 152898 5974
1 152904 9158
1 152911 7250
368401
64011
152906
Hint
This problem uses bundled testdata.
| Subtask | Special Property | Score | |
|---|---|---|---|
| None | |||
| Yes | |||
| None | |||
Special Property: after decoding, all queries satisfy .
For all data, it is guaranteed that:
$$0\le a_i,y\le 10^9, 1\le x_{\mathrm{real}},l_{\mathrm{real}}\le r_{\mathrm{real}}\le n$$and the encoded in the input are in .
It is guaranteed that at any time , and all numbers in the sequence are pairwise distinct.
Translated by ChatGPT 5