luogu#P7983. [JRKSJ R3] practiceZ
[JRKSJ R3] practiceZ
Background

Problem Description
Qinqin gives you two sequences and of length . You need to support a total of operations of three types:
1 l r x: Set all numbers in the interval of sequence to .2 l r y: Set all numbers in the interval of sequence to .3 l r: Compute . The answer is taken modulo .
Input Format
All inputs are integers.
Line contains two numbers .
Line contains numbers representing sequence .
Line contains numbers representing sequence .
The next lines each contain one operation. The format is the same as in the problem description.
Output Format
For each operation of type , output one integer per line as the answer.
4 5
5 5 4 5
3 4 4 1
2 3 3 2
2 2 3 4
3 1 4
1 3 3 2
3 2 4
57
39
5 5
1 7 5 2 5
2 1 5 3 2
1 5 5 3
1 3 5 2
3 1 4
2 1 4 2
3 1 3
33
24
10 10
27 29 12 16 16 6 20 22 17 1
2 6 1 10 4 1 3 10 9 6
2 3 5 6
3 2 10
2 5 10 9
3 5 9
1 1 5 24
1 6 10 12
3 2 3
1 4 6 14
1 4 8 14
3 5 10
956
825
264
924
Hint
This problem uses bundled judging.
Note: The original time limit was 5 s. Since it was rather strict on constant factors, it was changed by the admins to 7 s.
| Special property | Score | Dependencies | Time limit | |||
|---|---|---|---|---|---|---|
| None | None | |||||
| Random testdata | None | |||||
| None | ||||||
For of the data, , , , .
Translated by ChatGPT 5