← All problemsSign in

Subarray Sum Queries

CSESRange QueriesOpen on judge ↗

There is an array consisting of n integers. Some values of the array will be updated, and after each update, your task is to report the maximum subarray sum in the array. Input The first input line contains integers n and m: the size of the array and the number of updates. The array is indexed 1,2,\ldots,n. The next line has n integers: x_1,x_2,\ldots,x_n: the initial contents of the array. Th

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start