Problem 3956 · Hard

Maximum Sum of M Non-Overlapping Subarrays I

Fill a table of best totals for each prefix and number of chosen subarrays, extending by one subarray of allowed length at a time.

Open the interactive visualisation