MInimize SUM(|x — A[i]|*B[i]), i >= 0 and i < N, B[i] > 0

Правка en1, от Aafat_Wapas, 2019-07-31 13:01:42

How To Find the minimum value of the expression below:

SUM(|x - A[i]|*B[i]), i >= 0 and i < N, B[i] > 0

When B[i] = 1 I know the answer is given by x = Median(A).How to calculate x when B itself varies.

Теги #math, #sorting, #dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Aafat_Wapas 2019-07-31 13:01:42 272 Initial revision (published)