抢整练习# bagua - 娱乐八卦
s*t
1 楼
在careercup上面看的,题目看不是很懂,大家看看是问什么东西啊。
Given n elements, sort the elements. Here, only one operation is
permitted decreaseValue..
Note that you cannot swap the values.. output should be a sorted
list..
if input is 4 5 2 1 3
output is 3 3 3.. There can be many answers.. Give the optimum
solution with minimum cost. where as cost is the sum of decreased
amounts..
for this example, 4,5 are decreased by 1.. 2 is decreased by 2.. 1
is decreased by 1..
Given n elements, sort the elements. Here, only one operation is
permitted decreaseValue..
Note that you cannot swap the values.. output should be a sorted
list..
if input is 4 5 2 1 3
output is 3 3 3.. There can be many answers.. Give the optimum
solution with minimum cost. where as cost is the sum of decreased
amounts..
for this example, 4,5 are decreased by 1.. 2 is decreased by 2.. 1
is decreased by 1..