- 博客(3)
- 收藏
- 关注
转载 [tree]合并果子(哈夫曼树+优先队列)
现在有n堆果子,第i堆有ai个果子。现在要把这些果子合并成一堆,每次合并的代价是两堆果子的总果子数。求合并所有果子的最小代价。Input第一行包含一个整数T(T<=50),表示数据组数。 每组数据第一行包含一个整数n(2<=n<=1000),表示果子的堆数。 第二行包含n个正整数ai(ai<=100),表示每堆果子的果子数。 ...
2018-06-09 16:15:00 155
转载 Curling 2.0(dfs)
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 restricted to x and y directions. Diagonal ...
2018-06-09 10:35:00 109
转载 Super Reduced String
https://www.hackerrank.com/challenges/reduced-string/problemHe wants to reduce the string to its shortest length by doing a series of operations in which he selects a pair of adjacent lowercase...
2018-06-05 23:50:00 96
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人