作为acmer的小A,牛客网是他首选的题库。要使次数最小,而且每次只能将元素减1,故应当把所有数减到与最小值相等。我们也可以求出数组的数字之和sum,然后用sum减去最小值和数组长度的乘积,也能得到答案。
题目描述BSD is a lazy boy. He doesn't want to wash his socks, but he will have a data structure called 'socks heap'.By maintaining t
安科网(Ancii),中国第一极客网
Copyright © 2013 - 2019 Ancii.com
京ICP备18063983号-5 京公网安备11010802014868号