Stuck on This Question

Правка en6, от Utsavcc, 2024-06-17 14:51:06

Given an array of length N with elements array[i] (negative integers inclusive), maximize the Score of the array.

Score of the array = -seg[1]+seg[2]-seg[3]+seg[4].... where all seg[i] are the sum of non-intersecting segments of the array which constitute all of the array when combined We are also provided with an integer K, meaning the array must be divided into K segments.

We aren't given constraints in the problem statement. What is the optimised approach for this question.

Is it DP and if it is then what will be the state

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en6 Английский Utsavcc 2024-06-17 14:51:06 149
en5 Английский Utsavcc 2024-06-17 07:25:27 51 Tiny change: 'cases.\n\n' -> 'cases.\n\nIs it DP and if it is then what will be the state\n'
en4 Английский Utsavcc 2024-06-16 17:00:21 47
en3 Английский Utsavcc 2024-06-16 15:39:49 4
en2 Английский Utsavcc 2024-06-16 15:38:54 0 Tiny change: ' + seg[2] — seg[3] + ' -> ' + seg[2] - seg[3] + '
en1 Английский Utsavcc 2024-06-16 15:23:19 585 Initial revision (published)