Problem Statement
Fennec is fighting against N monsters. The health of the i-th monster is Hi. Fennec can do the following two actions:
• Attack: Fennec chooses one monster. That monster's health will decrease by 1.
• Special Move: Fennec chooses one monster. That monster's health will become 0.
There is no way other than Attack and Special Move to decrease the monsters' health.
Fennec wins when all the monsters' health become 0 or below.
Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.
Constraints
• 1≤N≤2×100000
• 0≤K≤2×100000
• 1≤Hi≤1000 000 000
• All values in input are integers.
问题描述
Fennec正在与N个怪物作战。第i个怪兽的生命值是Hi。Fennec可以执行以下两个操作:
•攻击:Fennec选择一个怪物进行攻击,该怪物的生命值会降低1。
•特别动作:Fennec选择一个怪物,该怪物的生命值将变为0(即被秒杀)。
除了“攻击”和“特殊移动”以外,没有其他方法可以降低怪物的生命值。
当所有怪兽的生命值都变为0或以下时,Fennec获胜。
当Fennec最多可以使用K次特别动作时,找到获胜前Fennec需要进行攻击(不算特殊动作)的最小次数。
约束条件
•1≤N≤2×100000
•0≤K≤2×100000
•1≤Hi≤1000000000
•输入中的所有值都是整数。