Description: In an orchard, a lot has shot down all the fruit, and of different types of fruit into a different pile. Decided to put all the fruit of a lot of synthetic pile. Each merger, a lot can be merged together two piles of fruit, equal to two piles of physical consumption of fruit and weight. It can be seen, all the fruit through the n-1 times after the merger, on the left a pile of. When a lot of fruit in the combined strength equal to the total consumption of each of the merger and the physical consumption. Because these also make great efforts to move the fruit home, so when a lot of fruit in the merger as much as possible to save energy. Assume that each fruit weight is 1, and the number of species known to fruit and the number of each type of fruit, your task is to design a combined order of programs, so a lot of physical least cost and physical output of the minimum cost value. For example, there are three kinds of fruit, followed by the number 1,2,9. 1,2 heap can be first merged, the
To Search:
File list (Check if you may need any files):
合并果子.txt
hebingguozi.cpp