#P7492. [传智杯 #3 决赛] 序列
[传智杯 #3 决赛] 序列
Description
You are given a sequence of length . You need to perform operations on it. There are two types of operations:
- Given two integers , query the maximum subarray sum in the range from to .
- Given three integers , bitwise OR every in the range from to with .
For all testdata, , , and .
Note: For negative numbers, the bitwise OR is computed using 32-bit two's complement.
Input Format
The input consists of lines.
The first line contains two positive integers .
The second line contains integers .
The next lines each start with one positive integer . If , then two integers follow, representing a query. Otherwise, three integers follow, representing an update.
Output Format
Output several lines. Each line contains one integer, which is the answer to a query.
15 15
512 -65 33554432 32 8194 13 16 2 67108872 131072 -8192 8194 16 2048 4096
1 3 5
1 10 10
2 1 7 671367424
1 8 14
1 5 11
2 13 13 335579137
2 2 13 5376
1 2 5
2 5 6 8392768
1 1 2
2 2 14 201335872
2 1 14 0
1 11 12
1 8 12
1 4 9
33562658
131072
67242012
2081350441
2047680290
671367936
201340226
805489228
3373416393
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号