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
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
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) |
Название |
---|