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

  • scheandslavelin
    压缩包包含有工程文件对应的电路图,以及电路图对应的LINslave节点的完整工程文件适用于MB95200系列单片机(Compression bags containing the corresponding circuit engineering documents, and the circuit node corresponding LINslave complete project file for the MB95200 Series MCU)
    2010-07-18 13:13:17下载
    积分:1
  • argox-cp-3140VCSharp_2005
    argox cp-3140的Visual C#测试用例。(argox cp-3140 Visual C# test example。)
    2013-12-22 11:24:20下载
    积分:1
  • CASHFLOW CCTALK 8052
    8051 BASED INTERFACE CCTALK PROTOCOL WITH CASHFLOW ACCEPTORS
    2018-06-05 18:55:19下载
    积分:1
  • grading-example-source
    grading example is the program developed for grading system...
    2011-06-13 18:53:05下载
    积分:1
  • Chapter14-MD2-Animation
    计算机图形学课程设计实例源码14 opengl基础内容,很实用(Computer graphics curriculum design example source 14 opengl based content, it is practical)
    2013-10-20 18:18:45下载
    积分:1
  • CPossionEquatl
    经典泊松方程的matlab数数值求解程序代码。可直接使用。 (Matlab the number of values ​ ​ of the classical Poisson equation solver code. Can be used directly.)
    2012-07-23 14:34:12下载
    积分:1
  • dianzhen-display
    这个代码在点阵上显示相应的图形。先将程序写入单片机,然后运行,显示相应的图片。(This code displays the corresponding graphics on the lattice. Write the first program the microcontroller, then run, display the corresponding picture.)
    2013-12-04 10:31:37下载
    积分:1
  • C#编写的一个记事本程序,可完美替代记事本。
    C#编写的一个记事本程序,可完美替代记事本。-C# Prepared a notebook of this procedure can be the perfect alternative to Notepad.
    2022-04-21 14:47:01下载
    积分:1
  • 多项式
    Visual C++语言,数据结构小程序,自定义系数及指数的多项式相加代码(Visual C++ language, data structure small program, custom coefficient and exponential polynomial addition code)
    2017-12-11 00:45:37下载
    积分:1
  • LCD_5110
    该程序包含了诺基亚5110显示屏的常用代码,包括清屏、液晶字节定位、液晶字符输出、液晶字符串输出、液晶汉字输出、液晶汉字词组输出、显示84X48图片、定位显示指定大小图片、定位输出数字等基本功能
    2023-05-28 11:55:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载