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

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

I was doing https://codeforces.com/contest/1420/problem/C1 which is a max sum alternating subsequence problem. I understand the dp solution but I fail to understand why adding the first number in the array then adding every positive arr[i] — arr[i-1] works if you have to choose numbers starting from the first element.

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