GSS3  Can you answer these queries III
You are given a sequence A of N (N <= 50000) integers between 10000 and 10000. On this sequence you have to apply M (M <= 50000) operations:
modify the ith element in the sequence or for given x y print max{Ai + Ai+1 + .. + Aj  x<=i<=j<=y }.
Input
The first line of input contains an integer N. The following line contains N integers, representing the sequence A1..AN.
The third line contains an integer M. The next M lines contain the operations in following form:
0 x y: modify Ax into y (y<=10000).
1 x y: print max{Ai + Ai+1 + .. + Aj  x<=i<=j<=y }.
Output
For each query, print an integer as the problem required.
Example
Input: 4 1 2 3 4 4 1 1 3 0 3 3 1 2 4 1 3 3 Output: 6 4 3
hide comments
codefucker1307:
20200805 21:15:06
a lot of WA attempts at GSS1 helped me in doing it in ONE go.


anonymousamigo:
20200803 06:52:25
help for those who got stuck


vandan6500:
20200713 09:19:39
GSS1 before this is a must 

ronythakur:
20200603 08:40:24
AC in a go, love solving segment trees problem


silent_1:
20200530 16:28:29
@dhruv gheewala change min value with 1e10


dhruvgheewala:
20200525 21:37:37
"Wrong Answer #0", Anyone can tell me, why i am getting like this, while my code works perfect for GSS1(AC) and i have checked my point update previously(it is also correct).


aman5898:
20200414 17:29:29
Ac in one go :p


abu_rifat:
20200408 23:04:58
"Wrong Answer #0" How?


huyquang2005:
20200323 19:52:33
bài hay 

fardin_abir:
20191128 05:45:59
A nice problem to solve... 
Added by:  Bin Jin 
Date:  20070803 
Time limit:  1s 
Source limit:  5000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: CPP 
Resource:  own problem 