摘要:
现在有n堆果子,第i堆有ai个果子。现在要把这些果子合并成一堆,每次合并的代价是两堆果子的总果子数。求合并所有果子的最小代价。 Input 第一行包含一个整数T(T<=50),表示数据组数。 每组数据第一行包含一个整数n(2<=n<=1000),表示果子的堆数。 第二行包含n个正整数ai(ai<=1 阅读全文
摘要:
The movement of the stone obeys the following rules: At the beginning, the stone stands still at the start square. The movements of the stone are rest 阅读全文