In this problem, you have to efficiently keep a vector with integers. There is just one update operation: given any position between 0 and , and an integer , set . Appart from that, you have to repeatedly report the maximum sum of all the consecutive subsequences of the current vector.
Input consists of several cases. Every case begins with , followed by the initial content of , followed by operations, each one with a pair . You can assume , , and .
For every case, print numbers: the maximum sum of consecutive elements inside the vector before the first update, and also after every update. Print a line with 10 dashes at the end of each case.
Author: Salvador Roura
Generation: 2026-01-25T11:33:34.901Z
© Jutge.org, 2006–2026.
https://jutge.org