Optimization of the DP slope in the garbage collection Series
Returned by the madman
It seems that the slope Optimization of DP has been very difficult, especially the scum of mathematics such as mine. I don't know what convex bag, what is convex and convex, ah... When talking about it, It is tears. I discussed it with WDD and came to some conclusions. Most of the articles in this Article refer to the accept article, but it seems that this article has been well written and poorly written. The first half is well described, but the key is, the key part is messy, with some mistakes. Many gods commented, but accept seems to have not changed the meaning, so I will resummarize it so that I can check and review it later.
The following is an example of print article. Printing a continuous article from I to J requires m + sigma (sum [J]-sum [I]) 2, and calculates the minimum fee for printing this article. The minimum charge is the number of times the data is printed. DP [I] indicates the minimum cost of printing from 1 .. I.
We have the DP transfer equation DP [I] = min (DP [J] + sigma (m + sum [I]-sum [J]) 2, DP [I]), j <I; check whether the data volume is 0 ≤ n ≤ 500000, and 0 ≤ m ≤, 50 thousand. If this is done directly, it is the complexity of O (n2) and the timeout is no doubt. How can this problem be solved? How to optimize the DP slope?
Optimization of the DP slope in the garbage collection Series