All topics are available in five languages. C implementation directory , C++ implementation directory , Python implementation directory , Java implementation directory , JavaScript implementation directory
topic
Given an integer array of length n, it represents the card score that a player can choose in n rounds. Players choose cards based on the rules, please calculate the highest total score they can get after all rounds.
The selection rules are as follows:
1: In each round, the player can choose to obtain the card face of that round, then his total score will be added to the card face score of this round to obtain the new total score