At the start of the year, I wrote a very painful implementation problem. My official solution was over 200 lines long and I was wondering if anyone could come up with a more elegant solution.
The problem is as follows:
Problem
# | User | Rating |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 165 |
3 | Um_nik | 161 |
3 | atcoder_official | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
A new definition of bad implementation
At the start of the year, I wrote a very painful implementation problem. My official solution was over 200 lines long and I was wondering if anyone could come up with a more elegant solution.
The problem is as follows:
...The S value of an array is the sum of maximum values across all continuous subsequences length at least one. In the array (4,5,1), the value is 4+5+1+5+5+5=25.
You are given an array $$$A$$$ of length $$$N$$$. There are $$$N$$$ updates, where the $$$i$$$th value of the array is increased from by a value $$$B_i$$$.
Output $$$N+1$$$ integers, the S value after every update.
$$$N \leq 5 \cdot 10^5$$$
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en5 | dvdg6566 | 2020-11-08 12:30:17 | 0 | (published) | ||
en4 | dvdg6566 | 2020-11-08 12:29:51 | 13 | Tiny change: 'ates, are \textbf{unique}. \n\nOutp' -> 'ates, are **unique**. \n\nOutp' | ||
en3 | dvdg6566 | 2020-11-08 12:28:47 | 30 | Tiny change: ':A_Wallaby,2020-11-08]. Majorit' -> ':A_Wallaby]. Majorit' | ||
en2 | dvdg6566 | 2020-11-08 12:27:48 | 1145 | |||
en1 | dvdg6566 | 2020-11-08 12:19:30 | 696 | Initial revision (saved to drafts) |
Name |
---|