Non-decreasing towers

Правка en2, от IMAN_GH, 2016-05-23 20:56:15

Consider array A with n elements.
In one operation you can decrease A[i] and increase A[i+1] (i < n & A[i] > 0).
g(A) equals the minimum number of operations to make array A non-decreasing.

Subtasks :

-- n <= 800 , 0 <= A[i] <= 10^3 , g(A) is required.
-- n <= 10^4 , 0 <= A[i] <= 10^12 , g(A) is required.

-- n <= 800 , 0 <= A[i] <= 10^12 , The sum of g for all A substrings is required.
-- n <= 10^4 , 0 <= A[i] <= 10^12 , The sum of g for all A substrings is required.

All of them mod 10^9 + 7.

(This problems prepared for CodeShark#4)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский IMAN_GH 2016-05-23 21:39:10 1 Tiny change: 'is problems prepared ' -> 'is problem prepared '
en2 Английский IMAN_GH 2016-05-23 20:56:15 28 (published)
en1 Английский IMAN_GH 2016-05-23 20:53:34 605 Initial revision (saved to drafts)