登录
首页 » C# » laquo; Problem description : In a train station, k, k track connected to the sid...

laquo; Problem description : In a train station, k, k track connected to the sid...

于 2023-04-18 发布 文件大小:976.00 B
0 99
下载积分: 2 下载次数: 1

代码说明:

« 问题描述:在一个列车调度站中,k条轨道连接到k条侧轨处,形成k个铁路转轨栈,从左到右依次记为H1,H2,…,Hk如下图所示。其中左边轨道为车皮入口(记为H0),右边轨道为出口(记为Hk+1),,编号为a , a , ,an 1 2  的n 个车皮从入口依次进入转轨栈,由调度室安排车皮进出栈次序,并对车皮按其出栈次序重新排序为1,2,…,n。调度室在安排车皮进出栈次序时,遵循以下规则:(1) 车皮入口H0处的车皮可以进入转轨栈H1,H2,…,Hk之一,或直接进入车皮出口Hk+1。(2) 转轨栈H1,H2,…,Hk处的车皮可以进入车皮出口Hk+« 编程任务:给定正整数n,和n个车皮的初始编号n a , a , ,a 1 2  ,编程计算最少需要多少个转轨栈才能按照规则(1)和(2)调度车皮,使车皮在车皮出口按照1,2,…,n的顺序输出。« 数据输入:由文件input.txt 给出输入数据。第1 行有1 个正整数n,表示有n 个车皮。第2 行是n个车皮的初始编号n a , a , ,a 1 2  。« 结果输出:将计算出的最少转轨栈数输出到文件output.txt。输入文件示例 输出文件示例input.txt output.txt42 3 4 13-laquo; 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), and numbered a, a, and an 1 2# 61516; The n followed by wagon from the entrance into the stack transition from

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • USB-keyboard
    C8051F340实现的USB键盘源代码,包括物理按键键值的获取,USB底层协议的实现、USB数据传输的实现。(C8051F340 USB keyboard source code, including the acquisition of physical keys keys, USB underlying protocol implementation, USB data transfer is achieved.)
    2013-09-12 15:12:01下载
    积分:1
  • echo-cancellation
    利用lms算法,实现回波抵消,消除回声信道返回的噪声信号。(Least means squares (LMS algorithm, realize the echo offset, eliminate the noise signal back to the echo channel.)
    2011-12-14 15:37:08下载
    积分:1
  • 车辆跟踪
    应用粒子滤波实现对车辆的检测与跟踪,此外,为了提高检测精度,应用卡尔曼滤波器实现对车辆位置参数的跟踪,过程简单。C++代码实现,结合opencv。
    2022-01-28 12:03:28下载
    积分:1
  • wave解析
    wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析wave文件解析
    2023-05-15 04:50:02下载
    积分:1
  • Tut_Machine.m
    这是一个用Matlab描述的关于X+Y的图灵机程序,希望对大家有些用(This is a description of the use of Matlab X+ Y on the Turing machine procedures, we hope to use some)
    2007-05-24 21:37:59下载
    积分:1
  • lightstripeExtraction
    基于梯度重心法的光条提取算法,实现光条中心的亚像素提取。(Extraction Method Based on Gradient focus light bar algorithms to achieve sub-pixel light stripe center extraction.)
    2016-06-08 11:22:38下载
    积分:1
  • 一个自己写的 C# BigInteger 类,.net 类库中没有 BigInteger 类,写此类是为了与 java 中的 BigInteger 对应,以方便...
    一个自己写的 C# BigInteger 类,.net 类库中没有 BigInteger 类,写此类是为了与 java 中的 BigInteger 对应,以方便大数运算-One wrote it myself C# BigInteger Class,. Net library does not BigInteger class, write these in order to correspond with the java in the BigInteger to facilitate the operation of large numbers
    2022-01-27 21:11:56下载
    积分:1
  • C#做的文本打印实例!开发环境竟然没有C#选择,可悲!...
    C#做的文本打印实例!开发环境竟然没有C#选择,可悲!-C# make a copy of print examples! Development environment for C has no choice, sad!
    2023-08-25 17:20:04下载
    积分:1
  • stm32-at24c64
    stm32 io模拟IIC,访问EEPROM,AT24C64(stm32 io simulation IIC, visit EEPROM, AT24C64)
    2015-08-24 08:28:57下载
    积分:1
  • VisualPCPPP2008rumenjingdian
    Visual+C+++2008入门经典(chinese).zip 中文翻译,精简(Visual+ C+++2008 Beginning (english). Zip Chinese translation, to streamline)
    2012-07-14 11:36:01下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载