文件名称:apple
介绍说明--下载内容来自于网络,使用问题请自行百度
程序设计,合并果子
例如有3种果子,数目依次为1,2,9。合并方案如下:
1. 将1、2合并,得到新堆数目为3,耗费体力为3。
2. 将新堆与第三堆合并,又得到新堆,数目为12,耗费的体力为12。
3. 总共消耗体力为 3 + 12 = 15,可以证明15为最小的体力耗费值。
输入
输入包括两行,第一行是一个整数 n (1<=n<=10000),表示果子的种类数。第二行包含 n 个整数,用空格分隔,第 i 个整数 ai (1<=ai<=10000)是第 i 种果子的数目。(Programming combines fruit
For example, there are 3 kinds of fruit, the number is 1, 2, 9. The merger scheme is as follows:
1. combined 1 and 2, the new heap number is 3, and the physical strength is 3.
2. combine the new heap with the third heap, and get the new heap, the number is 12, the energy consumption is 12.
3. of the total physical exertion was 3 + 12 = 15, and 15 could be proved to be the minimum physical exertion value.
input
The input consists of two rows, and the first line is an integer n (1< = n<=10000) indicating the number of fruits. The second line contains n integers, separated by spaces. The first I integer AI (1< = ai<=10000) is the number of the first I species.)
例如有3种果子,数目依次为1,2,9。合并方案如下:
1. 将1、2合并,得到新堆数目为3,耗费体力为3。
2. 将新堆与第三堆合并,又得到新堆,数目为12,耗费的体力为12。
3. 总共消耗体力为 3 + 12 = 15,可以证明15为最小的体力耗费值。
输入
输入包括两行,第一行是一个整数 n (1<=n<=10000),表示果子的种类数。第二行包含 n 个整数,用空格分隔,第 i 个整数 ai (1<=ai<=10000)是第 i 种果子的数目。(Programming combines fruit
For example, there are 3 kinds of fruit, the number is 1, 2, 9. The merger scheme is as follows:
1. combined 1 and 2, the new heap number is 3, and the physical strength is 3.
2. combine the new heap with the third heap, and get the new heap, the number is 12, the energy consumption is 12.
3. of the total physical exertion was 3 + 12 = 15, and 15 could be proved to be the minimum physical exertion value.
input
The input consists of two rows, and the first line is an integer n (1< = n<=10000) indicating the number of fruits. The second line contains n integers, separated by spaces. The first I integer AI (1< = ai<=10000) is the number of the first I species.)
相关搜索: WINDOWS 编程
(系统自动生成,下载前可以参看下载内容)
下载文件列表
apple\apple\apple.cpp
apple\apple\apple.vcxproj
apple\apple\apple.vcxproj.filters
apple\apple\Debug\apple.log
apple\apple\Debug\apple.obj
apple\apple\Debug\apple.pch
apple\apple\Debug\apple.tlog\apple.lastbuildstate
apple\apple\Debug\apple.tlog\CL.read.1.tlog
apple\apple\Debug\apple.tlog\CL.write.1.tlog
apple\apple\Debug\apple.tlog\link.read.1.tlog
apple\apple\Debug\apple.tlog\link.write.1.tlog
apple\apple\Debug\stdafx.obj
apple\apple\Debug\vc120.idb
apple\apple\Debug\vc120.pdb
apple\apple\ReadMe.txt
apple\apple\stdafx.cpp
apple\apple\stdafx.h
apple\apple\targetver.h
apple\apple.sdf
apple\apple.sln
apple\apple.v12.suo
apple\Debug\apple.exe
apple\Debug\apple.ilk
apple\Debug\apple.pdb
apple\ipch\apple-b4c4e286\apple-368c7bbe.ipch
apple\apple\Debug\apple.tlog
apple\apple\Debug
apple\ipch\apple-b4c4e286
apple\apple
apple\Debug
apple\ipch
apple
apple\apple\apple.vcxproj
apple\apple\apple.vcxproj.filters
apple\apple\Debug\apple.log
apple\apple\Debug\apple.obj
apple\apple\Debug\apple.pch
apple\apple\Debug\apple.tlog\apple.lastbuildstate
apple\apple\Debug\apple.tlog\CL.read.1.tlog
apple\apple\Debug\apple.tlog\CL.write.1.tlog
apple\apple\Debug\apple.tlog\link.read.1.tlog
apple\apple\Debug\apple.tlog\link.write.1.tlog
apple\apple\Debug\stdafx.obj
apple\apple\Debug\vc120.idb
apple\apple\Debug\vc120.pdb
apple\apple\ReadMe.txt
apple\apple\stdafx.cpp
apple\apple\stdafx.h
apple\apple\targetver.h
apple\apple.sdf
apple\apple.sln
apple\apple.v12.suo
apple\Debug\apple.exe
apple\Debug\apple.ilk
apple\Debug\apple.pdb
apple\ipch\apple-b4c4e286\apple-368c7bbe.ipch
apple\apple\Debug\apple.tlog
apple\apple\Debug
apple\ipch\apple-b4c4e286
apple\apple
apple\Debug
apple\ipch
apple
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.