Блог пользователя Libraion

Автор Libraion, история, 3 года назад, По-английски

Given an array of $$$N$$$ $$$(1 \le N \le 10^5)$$$ elements $$$A_1,A_2,\dots,A_N$$$ $$$(1 \le A_i \le 10^6)$$$. You can replace $$$2$$$ consecutive elements with their sum. Find the minimum number of replacements such that the resulting array is non-decreasing.

As you can easily see, it is the same as split $$$A$$$ into maximum number of segments such that their sums from left to right is non-decreasing.

Thanks.

  • Проголосовать: нравится
  • +61
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +97 Проголосовать: не нравится

Words are not enough to describe the distress that this problem has caused me. I suffered more anxiety while trying this problem than I have felt in my entire life up to this point. I felt more depressed after each WA than I felt during some of the funerals of some people close to me. This problem has been very important in changing my perception of the world, as I now understand the true depths of despair.

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I think this task is almost the same. My spoilers are for the linked problem.

Spoiler 1
Spoiler 2
»
3 года назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится