登录
首页 » 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 60
下载积分: 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 个回复

  • 51bujindianji
    说明:  51单片机驱动步进电机电路及程序 内容详细,通俗易懂,很值得(51bujindianji)
    2009-07-28 22:13:02下载
    积分:1
  • serial port send and receive
    send and receive,serial port real time
    2022-05-22 09:50:53下载
    积分:1
  • NT驱动开发代码
    创建设备对象 驱动链表 快查表 内存分配+进程显示 NewDelete重写(Create device objects Drive list Quick look up table Memory allocation + process display New Delete Rewrite)
    2018-12-13 17:27:40下载
    积分:1
  • Mesh_Simplification
    三角网格简化的边塌缩算法实现,网格输入文件支持标准.obj格式(bin文件夹中附有一个,可用notepad打开),化简后通过OpenGL显示结果(Triangle mesh simplification edge collapse algorithm, the grid supports standard input file. Obj format (bin folder with a notepad available to open), after simplification of the result will be displayed through the OpenGL)
    2008-07-13 22:05:14下载
    积分:1
  • IC4094驱动代码
     IC4094-IO口扩展芯片驱动源代码
    2022-03-15 08:16:37下载
    积分:1
  • 电子购物商城系统C#
    电子购物商城系统C#   前台后台所有代码和js   同样的模块方便套用 省去大部分时间
    2022-03-22 19:47:19下载
    积分:1
  • LCD
    stm32液晶屏代码,通过按键使液晶屏显示的内容上下左右移动(Stm32 LCD code, through the buttons to make the content of the LCD display top to bottom and move around)
    2015-05-17 22:29:03下载
    积分:1
  • vbzhenxinhua
    VB_真心话大冒险游戏源码,一个VB编写的小游戏,脑筋急转弯游戏源码(Game the VB_ truth or dare game source code, written in VB, Riddles game source)
    2013-04-04 15:24:52下载
    积分:1
  • 21840268cure
    cure算法的c语言完美实现,值得借鉴并运用(cure the perfect realization of the algorithm c language, it is worth learning and using)
    2009-11-16 14:36:09下载
    积分:1
  • MATLAB
    C语言与MATLAB接口:编程与实例,实现接口Matlab与C语言编程互换(C language and MATLAB interfaces: programming with examples, the interface with Matlab and C programming language swap)
    2012-05-28 06:16:25下载
    积分:1
  • 696516资源总数
  • 106442会员总数
  • 11今日下载