2638Big fish eating small fish

2638   Big fish eating small fish

题目描述

Cindy bought some fishes and put them into her pond. However, after a while, she found some small fishes were eaten by some other big fishes. Assuming that during that time, each fish could eat at most one fish which was smaller than it. Please determine the possible minimum sum of remaining fishes’ sizes.

输入格式:

There are multiple cases.

For each case, the first line is an integer N (1<=N<=105), indicating Cindy has bought N fishes. The second line has N integers Si (1<=Si<=104), indicating each fish’s size.

输出格式:

For each case, print the possible minimum sum of remaining fishes’ sizes.
输入样例 复制
4
1 2 3 5
3
10 10 10
输出样例 复制
5
30

说明

8
51
通过提交
时空限制1000ms/32mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度