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 | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 4 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
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 |
|---|


