We are given two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. Consider the following recurrence relation:
We are interested in calculating $$$f(n)$$$. Is there a way to calculate it with the time complexity being better than $$$\mathcal{O}(n^2)$$$?
| # | 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 | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 134 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
How to optimize this DP solution?
We are given two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. Consider the following recurrence relation:
We are interested in calculating $$$f(n)$$$. Is there a way to calculate it with the time complexity being better than $$$\mathcal{O}(n^2)$$$?
| Rev. | Lang. | By | When | Δ | Comment | |
|---|---|---|---|---|---|---|
| en4 |
|
suzie_q | 2022-04-23 02:41:14 | 16 | Tiny change: 'ay $b$ is monotone (ie $b[i] \le' -> 'ay $b$ is increasing (i.e. $b[i] \le' | |
| en3 |
|
suzie_q | 2022-04-23 02:40:30 | 123 | Tiny change: '{O}(n^2)$?' -> '{O}(n^2)$?\n\n**UPD:**' | |
| en2 |
|
suzie_q | 2022-04-22 23:14:22 | 1 | ||
| en1 |
|
suzie_q | 2022-04-22 23:13:37 | 366 | Initial revision (published) |
| Name |
|---|


