文件名称:shizihebing
介绍说明--下载内容均来自于网络,请自行研究使用
经典石子合并问题全代码
在一个园形操场的四周摆放N堆石子(N≤100),现要将石子有次序地合并成一堆。规定
每次只能选相邻的两堆合并成新的一堆,并将新的一堆的石子数,记为该次合并的得分。
编一程序,由文件读入堆数N及每堆的石子数(≤20),
①选择一种合并石子的方案,使得做N-1次合并,得分的总和最小;
②选择一种合并石子的方案,使得做N-1次合并,得分的总和最大。-The merging of classic rock in a park-wide code-shaped around the playground gravel placed N Reactor (N ≤ 100), is to have the order to stone into a pile. The provisions of the election can only be adjacent to each两堆into a pile of new, and a pile of stones a new number in mind for its combined score. For a procedure, read by the document number N and every heap of stones piled several (≤ 20), ① select a stone of the combined program, the N-1 times to do the merger, the sum of the minimum score ② Choose a merger stones program, the N-1 times to do the merger, the largest sum of scores.
在一个园形操场的四周摆放N堆石子(N≤100),现要将石子有次序地合并成一堆。规定
每次只能选相邻的两堆合并成新的一堆,并将新的一堆的石子数,记为该次合并的得分。
编一程序,由文件读入堆数N及每堆的石子数(≤20),
①选择一种合并石子的方案,使得做N-1次合并,得分的总和最小;
②选择一种合并石子的方案,使得做N-1次合并,得分的总和最大。-The merging of classic rock in a park-wide code-shaped around the playground gravel placed N Reactor (N ≤ 100), is to have the order to stone into a pile. The provisions of the election can only be adjacent to each两堆into a pile of new, and a pile of stones a new number in mind for its combined score. For a procedure, read by the document number N and every heap of stones piled several (≤ 20), ① select a stone of the combined program, the N-1 times to do the merger, the sum of the minimum score ② Choose a merger stones program, the N-1 times to do the merger, the largest sum of scores.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
石子合并问题(完整).cpp