#P10638. BZOJ4355 Play with sequence
BZOJ4355 Play with sequence
Problem Description
Maintain an integer sequence of length , supporting three operations:
1 u v c: for , change to .2 u v c: for , change to .3 u v: output the value of .
Input Format
The first line contains two positive integers , representing the sequence length and the number of operations.
The second line contains integers , representing the initial state of the sequence.
Starting from the third line, the next lines each describe one operation.
Output Format
Output several lines, one integer per line, answering each operation in order.
5 3
6 4 6 6 4
2 1 5 -5
1 3 4 4
3 1 5
2
Hint
For of the testdata, , .
- For operation , it is guaranteed that .
- For operation , it is guaranteed that .
For all operations, it is guaranteed that .
Translated by ChatGPT 5