Problem bugging me for a few hours

Правка en1, от Aspergillus, 2024-08-07 00:00:55

Given an array, you can pick up to $$$x$$$ (where $$$x \leq 3$$$) elements in one operation and decrease each of them by 1 (all picked elements must be at least 1). You then add $$$x$$$ points to your score. You need to maximize your points with these operations applied any number of times as long as it is possible.

I think you could use a priority queue to greedily pick the top $$$x$$$ largest elements and decrease them by 1, but the problem is that the elements can go up to $$$10^{16}$$$.

Also, the length of the array is at most 200.

Теги help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Aspergillus 2024-08-07 00:00:55 562 Initial revision (published)