railk

所属分类:数据结构
开发工具:Visual C++
文件大小:29KB
下载次数:12
上传日期:2006-03-29 21:20:00
上 传 者stzxxxstz
说明:  最优车皮排序问题 .问题描述: 在一个列车调度站中,k 条轨道连接到k 条侧轨处,形成k 个铁路转轨栈,从左到右依 次记为H1,H2,…,Hk 如下图所示。其中左边轨道为车皮入口(记为H0),右边轨道为出 口(记为Hk+1),编号为a1, a2,.,an 的n 个车皮从入口依次进入转轨栈,由调度室安排车 皮进出栈次序,并对车皮按其出栈次序重新排序为1,2,…,n。 调度室在安排车皮进出栈次序时,遵循以下规则: (1) 车皮入口H0 处的车皮可以进入转轨栈H1,H2,…,Hk 之一,或直接进入车 皮出口Hk+1 。 (2) 转轨栈H1,H2,…,Hk 处的车皮可以进入车皮出口Hk+1 。 .编程任务: 给定正整数n,和n 个车皮的初始编号a1, a2,.,an ,编程计算最少需要多少个转轨栈 才能按照规则(1)和(2)调度车皮,使车皮在车皮出口按照1,2,…,n 的顺序输出。 .数据输入: 由文件input.txt 给出输入数据。第1 行有1 个正整数n,表示有n 个车皮。第2 行是n 个车皮的初始编号a1, a2,.,an 。
(wagon optimal scheduling problem. Problem description : In a train station, k, k track connected to the side of the tracks, forming k stack rail transition from left to right followed credited to H1, H2, ..., Hk as in the figure below. Which left orbit for imported cars (credited to H0), the right track for exports (credited as a Hk), the No. a1, a2,. , An n-wagon from the entrance into the transition stack followed by the dispatch room arrangements wagon Stack access priorities, as well as cars stack up according to the order reordering of 1,2, ..., n. The dispatch room in arranging access stack wagon order, to abide by the following rules : (1) H0 wagon entrance of cars can enter the transition stack H1, H2, ..., Hk, or directly into a wagon export Hk. (2) Transition stack H1, H2, ..., H)

文件列表:
railk\railk.cpp (1771, 2006-03-10)
railk\railk.pdf (39845, 2006-03-27)
railk\railk.txt (993, 2006-03-27)
railk (0, 2006-03-27)

近期下载者

相关文件


收藏者