HDOJ 1022 Train Problem I(栈)

极域电子教室豪华版2016.rar 极域电子教室豪华版2016.rar 里面有教师端和学生端,还有破解版,破解版直接覆盖教师端里面的文件就好了。是一个教学工具,教师端控屏软件。电子教室。 立即下载


http://acm.hdu.edu.cn/showproblem.php?pid=1022

Train Problem I

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 20606    Accepted Submission(s): 7753


Problem Description
As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a problem, there is only one railway where all the trains stop. So all the trains come in from one side and get out from the other side. For this problem, if train A gets into the railway first, and then train B gets into the railway before train A leaves, train A can't leave until train B leaves. The pictures below figure out the problem. Now the problem for you is, there are at most 9 trains in the station, all the trains has an ID(numbered from 1 to n), the trains get into the railway in an order O1, your task is to determine whether the trains can get out in an order O2.
 


Input
The input contains several test cases. Each test case consists of an integer, the number of trains, and two strings, the order of the trains come in:O1, and the order of the trains leave:O2. The input is terminated by the end of file. More details in the Sample Input.
 


Output
The output contains a string "No." if you can't exchange O2 to O1, or you should output a line contains "Yes.", and then output your way in exchanging the order(you should output "in" for a train getting into the railway, and "out" for a train getting out of the railway). Print a line contains "FINISH" after each test case. More details in the Sample Output.
 


Sample Input
  
3 123 321 3 123 312
 


Sample Output
  
Yes. in in in out out out FINISH No. FINISH
Hint
Hint
For the first Sample Input, we let train 1 get in, then train 2 and train 3. So now train 3 is at the top of the railway, so train 3 can leave first, then train 2 and train 1. In the second Sample input, we should let train 3 leave first, so we have to let train 1 get in, then train 2 and train 3. Now we can let train 3 leave. But after that we can't let train 1 leave before train 2, because train 2 is at the top of the railway at the moment. So we output "No.".
 
#include<stdio.h>
#include<string.h>
int main()
{
	char IN[1000],OUT[1000],stack[1000];
	int a[2000],N,i,j,k;
	while(scanf("%d %s %s",&N,IN,OUT)!=EOF)
	{
	      int top=-1;
		  for(i=0,j=0,k=0;i<=N&&j<N;)
		  {
		       if(stack[top]==OUT[j]&&top!=-1)
		       {
		       	   top-=1;
		       	   j+=1;
		       	   a[k]=0;
		       	   k+=1;
		       	  // printf("%d#\n",top);
		       }		   
			   else
			   {
			       top+=1;
				   stack[top]=IN[i];
				   i+=1;
				   a[k]=1;
				   k+=1;
			   }
		 }
		 if(top==-1)
		 {
		 	printf("Yes.\n");
		 	for(i=0;i<2*N;i++)
		 	if(a[i]==0)
		 	printf("out\n");
		 	else
		 	printf("in\n");
		 }
		 else
		 printf("No.\n");
		 printf("FINISH\n");
	}
	return 0;
}

JiYuTrainer:极域电子教室防控制软件, StudenMain.exe 不再被极域电子教室控制 简介 本软件研发目的就是为了对抗极域电子教室,如果您的学校机房使用极域电子教室来控制学生电脑的话,本软件很可能会帮到你。 讲师讲课无聊啰嗦缓慢?想自己试试操作,却被该死的全屏广播控制,什么都不能干?拔掉网线后虽然自由了但是又看不到老师的演示了? 如果你被以上问题困扰,本软件可能是您非常想要的。 这是一个可以使 极域电子教室全屏广播失效 的软件,也就是说,在被老师全屏广播时,会将其自动调整为窗口模式,你不仅可以自由操作电脑,也还可以看老师的演示,自由+学习两不误,这不是很爽的事情吗?其还可以防止被老师控制(有点狠),以及自动关闭 “黑屏安静” 这种东西;由于本软件是将全屏调整为窗口,因此老师并不会发现你断线或是进行了非法操作。 如果你喜欢这个软件,不妨向你的好友推荐一下吧! 如果你觉得这个软件不错,不妨加个小星星:star:吧,你的喜欢是对我最大的支持! 功能 在不影响极域正常 立即下载

相关推荐

JiYuTrainer(最新版!)

别人怎么是付费的?这是个开源软件吧!(by 快乐的梦鱼) 你有没有被极域电子教室控制的经历,用这个软件吧! JiYuTrainer-master,可以直接杀死极域电子教室、解除屏幕广播与黑屏、阻止极域控制电脑等。 操作说明在软件里,非常简单。

hdu1022

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12902    Accepted Submission(s): 4726 Problem Description As the new te

rhy 457

MATLAB/simulink电力系统之变压器仿真+变压器饱和仿真+空载变压器电流畸变原因及仿真+空载合闸励磁涌流仿真+simulink免费仿真资源

单相变压器空载运行时,原边电流主要用来产生主磁场,而电路损耗和铁芯损耗很小,因此即使外加电压很大,空载电流仍然很小。如果想观察某个相对磁导率下电感系数的数值,可以在程序中增加这样的语句,比如,在程序中end语句之后,加上L(100),运行程序后就可以得到相对磁导率为 100时的电感系数值。在交流铁芯线圈中,当交变磁通按照正弦规律变化时,受到磁路饱和的影响,线圈中的电流会发生畸变,并成为尖顶波,这就是所谓的交流磁路电流畸变。需要指出,铁芯内的主磁通Ф可以通过空载时的副边电压从来测量,两者之间的数学关系,即。

m0_37724753的博客 4238

A - Train Problem II ( 火车和卡特兰数 )

As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the r...

dianli6932的博客 174

E5071C 网络分析仪使用指南

E5071C 网络分析仪是 Keysight(原 Agilent)推出的一款高性能矢量网络分析仪,广泛应用于射频(RF)和微波(MW)电路设计、天线测试、滤波器优化等领域。它以高精度、宽频率范围(9 kHz–20 GHz)、出色的动态范围和灵活的测量功能著称。本文将详细介绍 E5071C 的基本操作方法,帮助用户快速上手并高效使用该设备。

2501_90901792的博客 4206

香橙派5使用RK3588S内置NPU加速yolov5推理,实时识别数字达到50fps

香橙派5采用了RK3588S,内置的NPU达到了6Tops的算力,博主这里记录一下自己的踩坑过程,好不容易做出来的不能以后忘记了(手动狗头)。这里博主还在B站上发布了效果视频,大家感兴趣的话可以看一下。其中解决了先验框标注位置不对,或者出现非常多的框的问题

weixin_51651698的博客 2万+

HDU 1022题解

As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all ov...

EternaKing的博客 392

Scratch-陶陶摘苹果

Scratch版-陶陶摘苹果([蓝桥杯][算法]) 题目要求: 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果。苹果成熟的时候,陶陶就会跑去摘苹果。陶陶有个30厘米高的板凳,当她不能直接用手摘到苹果的时候,就会踩到板凳上再试试。 现在已知10个苹果到地面的高度,以及陶陶把手伸直的时候能够达到的最大高度,请帮陶陶算一下她能够摘到的苹果的数目。假设她碰到苹果,苹果就会掉下来。 用scratch怎么完成呢? 首先加入角色题目介绍 接下来用询问框来录入苹果的高度并且记录到列表里 数据初始化 .

qq_38784092的博客 2907

Train Problem I

As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over t...

年轻过成了秃顶 379

为什么需要知识图谱?什么是知识图谱?——KG的前世今生

我的知乎专栏,对知识图谱感兴趣的朋友可以关注。标题的命名顺序可能让有的读者不太习惯。通常在介绍一个陌生事物的应用前,我们先给出其定义。之所以换个顺序,是为了不让读者一开始就接触比较冰冷生硬的概念刻板描述(后面我尽量用更具体、准确的例子来表达),另一方面也是为了通过现实生活中的例子自然的引入知识图谱的概念。希望通过这种方式加深读者的印象和理解。为了减轻读者理解的负担,我尽可能地避免引入过多的概念和技术

SimmerChan的专栏 8万+

【100分- 求最多可以派出多少支团队】(题目+思路+Java&C++&Python解析+在线测试)

用数组代表每个人的能力,一个比赛活动要求参赛团队的最低能力值为N,每个团队可以由1人或者2人组成,且1个人只能参加1个团队,计算出最多可以派出多少只符合要求的团队。

m0_73659489的博客 319

每日算法练习——Train Promblem1(铁轨问题)

题目来源:航电OJ http://acm.hdu.edu.cn/showproblem.php?pid=1022 题目: Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school...

地址ch3nye.top 1324

把 SAP OData 查询模式讲透:从 $select 到 $expand 的设计、实现与性能边界

摘要:本文深入探讨SAP生态中OData查询模式的核心设计与实现要点。文章指出,OData不仅是接口协议,更是HTTP、REST与数据模型的统一语言,其性能关键取决于查询选项($select、$filter等)的设计与实现质量。重点分析了$select的投影优化、$orderby的排序语义、$filter的数据库下推策略,以及$count的高效计数方法。通过具体示例和最佳实践,强调应将查询逻辑尽量下推至数据库层,避免在ABAP应用层处理大数据集,从而提升服务性能、降低资源消耗,实现Clean Core架构理

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 663

hdoj1022------------------Train Problem I---栈

Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is

Life is Float. 668

ISP 芯片作为独立设备节点的驱动实现要点:多平台结构差异与工程部署策略解析

随着 ISP(Image Signal Processor)从 SoC 集成形态向独立芯片模块演进,在多摄系统、高动态场景、AI 图像前处理等需求下,ISP 作为单独设备节点进行驱动设计已成为主流趋势。尤其在多 SoC 平台(如高通、联发科、展锐、Rockchip)中,不同厂商对 ISP 的抽象方式与驱动接口处理存在显著差异。本文以实际工程为基础,从 Linux 内核下的设备注册流程、media\_entity 配置、VideoDevice 分配、数据 DMA 管理、与 sensor 的流同步控制等关键点展

努力分享一些人工智能、计算机视觉、影像等相关的知识干货! 1471

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

HDOJ 1022 Train Problem I(简单栈)

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25517    Accepted Submission(s): 9640 Problem Description As the new te

滴水穿石,慢慢积累,总会有成果 404

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

hdoj-1022-Train Problem I(栈)

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25857    Accepted Submission(s): 9761 Problem Description As the

网络二师兄 581

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

HDOJ1022. Train Problem I(栈)

Train Problem ITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43515    Accepted Submission(s): 16310Problem DescriptionAs the new term comes, t...

cr496352127的博客 246

模拟栈的出入 HDOJ 1022 Train Problem I

题目传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1022题目大意是给出一个入栈的序列,判断一个给出的序列是否可能是一个合法的出栈序列,若是,给出入栈和出栈的过程。#include <iostream> #include <cstring>using namespace std;int main(int argc, char const *argv[

nNbS 350

HDOJ 1022 Train Problem I(栈)

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26100    Accepted Submission(s): 9852 Problem Description As the new te

阿金的ACM 855

hdoj 1022 Train Problem I【栈】

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26563    Accepted Submission(s): 10043 Problem Description As the new t

平平淡淡才是真 359

HDOJ1022 Train Problem I 栈模拟

#include"stdio.h" #include"string.h" main() { char in[10],out[10],stack[10],str[2][4]={"out","in"}; int n,i,top,ans[20],j,rear,flag,k; while(scanf("%d %s %s",&n,in,out)!=EOF) {

Kizuki 476

hdoj 1022 Train Problem I(栈)

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 28666    Accepted Submission(s): 10889 Problem Description As the new t

Calm微笑 490

hdoj 1022 Train Problem I (第一次接触栈)

思路:定义一个栈,将火车一个个放入栈中,直到出现一个火车(该火车要先出去),等所有火车都进入完栈,并且都出完栈,返回yes+方法,否则返回no; 代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or inpu

摆渡人的博客 189

HDOJ Train Problem I 1022(栈)

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 23579    Accepted Submission(s): 8910 Problem Description As the new te

豫帝哥哥 946

HDOJ/HDU 1022 Train Problem I(模拟栈)

Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is th

谙忆-陈浩翔 8987
上一篇: hdoj 2206 IP的计算
下一篇: NYOJ 题目2 括号配对问题
SimonCoder
博客等级 码龄13年 1413粉丝 231原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址