LCC '21 Contest 1 J1 - Costume Contest

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Eric is participating in a Halloween-themed costume contest!

N judges are admiring Eric's costume and the ith judge gives Eric a score of s_i.

Unfortunately, the judging panel collectively agrees that Eric's costume is too cute, so in order to level the playing field, they decide to remove his highest score. If the highest score is given by multiple judges, only one instance of the score is removed. Can you help him figure out his total score?

Input Specification

The first line contains an integer representing the number of judges, N (1 \le N \le 10^{5}).

The next line contains N space-separated integers, s_i (0 \le s_i \le 100), representing the judge's scores.

Output Specification

Output an integer representing Eric's total score after his highest score is removed.

Sample Input

5
79 58 92 46 85

Sample Output

268

Comments


  • -8
    xToppz  commented on Nov. 7, 2021, 1:13 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.