help

Правка en1, от darkworld1, 2018-11-12 12:42:21

you have given an array you have to maximize the cost factor of array and cost can be calculated in following way COST = A*a[i]-B*a[j]+C*a[k]+D*a[l]+E*a[m] where i<j<k<l<m

now you have given A,B,C,D,E , maximize the cost of given array

sample test case n= 5 array = { 10 17 15 6 17} A=8, B=5, C=4, D=6, E=9

Output is 172

Теги #dp, two pointers

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский darkworld1 2018-11-12 13:09:46 313
en3 Английский darkworld1 2018-11-12 12:43:31 6
en2 Английский darkworld1 2018-11-12 12:42:58 2 Tiny change: 'ing way \nCOST = A' -> 'ing way \n\nCOST = A'
en1 Английский darkworld1 2018-11-12 12:42:21 344 Initial revision (published)