Dynamic Programming21 sections · 916 units
Open in Course

Codeforces 455A Boredom - Problem Statement

A similar structure

You have an array of positive integers. When you pick an element with value kk:

1.1. You earn kk points

2.2. Delete THAT ONE element you chose

3.3. Delete ALL elements equal to k+1k+1 and k1k-1 Here's the key: you don't delete all occurrences of kk itself.

You only delete the one element you picked. Other elements with value kk can still be picked later. Goal: get the highest total points.