Can sb tell me about how to optimize dp with DnC and Convex Hull Trick and pls differenciate two algorithm
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 135 |
| 7 | adamant | 135 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
Can sb tell me about how to optimize dp with DnC and Convex Hull Trick and pls differenciate two algorithm
| Name |
|---|



DnC and Convex Hull Trick is not that important if you only want to participate in VOI lol bro
ok
Convex hull trick (and LiChao)
DnC trick
They are completely different.
perhaps it`s worth at least reading some articles about these algorithms before asking questions about them
I mean they both have the optimal point is non-decreasing?
Both speed up DP transitions that would normally be O(N^2), but they work in different ways.
D&C relies on the fact that the best split point only moves right as you go forward. So you solve the middle position first by checking all candidates, then solve the left half using only candidates to the left of that best point, and the right half using only candidates to the right. This brings each layer down to O(N log N). It works for layered DPs like "split an array into K groups" where the cost is some function of a range.
Convex Hull Trick relies on the formula itself. If the transition can be rewritten so each old state is a straight line, then computing a new state just means finding the lowest (or highest) line at a given x. You only keep the lines that matter, and with sorted slopes and queries it runs in O(N).
So that means Convex Hull Trick doesnt have optimal optimal point ascending?