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

  • ewarm_full_arm540
    IAR Embedded Workbench for ARM
    2011-03-01 20:19:45下载
    积分:1
  • QXAPRK
    是PDA如何打开BMP文件,如何显示在PDA屏目上,使用EVC4编译,在HP3210PDA上动行通过(PDA is how to open the BMP file, how to display on the PDA screen mesh, using EVC4 compilation, moving on HP3210PDA line through)
    2017-04-12 02:50:16下载
    积分:1
  • music
    说明:  传统的MUSIC算法用于声源定位,确定信号源的方向角(Conventional MUSIC algorithm for sound source position to determine the source of the direction angle)
    2009-08-12 11:07:07下载
    积分:1
  • DSP28335
    说明:  DSP 28335开发例程,包括串口通讯、PWM等经典开发例程(DSP 28335 development routine, including serial communication, PWM and other classical development routines)
    2019-06-28 15:02:58下载
    积分:1
  • function
    基于VC++的图像处理类,可以用于bmp文件的读写,显示(Based on the image processing VC++ classes that can be used to read and write bmp files, display)
    2013-11-18 11:16:59下载
    积分:1
  • C#计算器
    说明:  采用窗体程序实现一简单计算器,计算器具有加减乘除以及开方功能,功能采用Dll方式封装。(A simple calculator is realized by the window program. The calculator has the functions of addition, subtraction, multiplication and division as well as square cutting. The functions are encapsulated by DLL.)
    2020-02-20 23:01:59下载
    积分:1
  • 一个matlab程序实例,非常清楚,有仿真图像,欢迎下载。多多指点...
    一个matlab程序实例,非常清楚,有仿真图像,欢迎下载。多多指点-a Matlab procedures example, it is clear, and image simulation are welcome to download. Guidance lot
    2022-02-20 01:32:11下载
    积分:1
  • MyProjects
    使用MFC ODBC和LISTCONTROL控件显示数据库表内容(Use MFC ODBC and LISTCONTROL control display the contents of database tables)
    2007-12-18 15:24:47下载
    积分:1
  • Audio_signal_spectrum_analysis
    libwindow/cvi程序,对音频信号进行频谱分析(libwindow/cvi,The audio signal spectrum analysis)
    2013-09-23 20:55:56下载
    积分:1
  • BPBPBPBPN
    BP神经网络源程序 很好用 已经经过调试 希望能给大家带来帮助(BP neural network has been very easy to use source code debugging We hope you help)
    2011-09-21 16:30:12下载
    积分:1
  • 696518资源总数
  • 105895会员总数
  • 18今日下载