#P8563. Magenta Potion
Magenta Potion
Problem Description
You are given an integer sequence of length , where the absolute value of every number is at least . There are operations of the following forms:
: modify to . It is guaranteed that the absolute value of is at least .
: consider the maximum subarray product among all subintervals of (including itself). If , output Too large; otherwise output . In particular, the product of elements of an empty interval is defined as .
Input Format
The first line contains two positive integers and .
The second line contains integers .
The next lines each contain three integers describing one operation, in the format given above.
Output Format
For each operation, output one line containing the answer to the query.
5 7
2 2 3 4 5
2 1 5
1 3 -3
2 1 5
2 3 3
1 1 100000
1 2 100000
2 1 2
240
20
1
Too large
Hint
For all testdata, , , .
$$\def\arraystretch{1.5} \begin{array}{c|c|c}\hline \textbf{测试点编号}&\bm{~~~~~~~~n,q\le~~~~~~~~}&~~~~\textbf{特殊限制}~~~~\cr\hline \textsf1\sim \sf2 & 10& \cr\hline \sf3\sim 6 & 100& \cr\hline \sf7\sim 10 & 5 \times 10^3&\cr\hline \sf 11\sim 13 & &\sf A\cr\hline \sf14\sim 16 & & \sf B\cr\hline \sf17\sim 20 & &\cr\hline \end{array}$$: it is guaranteed that .
: it is guaranteed that for each query, the corresponding .
Translated by ChatGPT 5