#include<iostream>
#include<cstdio>
#include<string>
#define MAXN 10
using namespace std;
int s[MAXN], p[MAXN];
string in, out;
int main(){
int n, flag, k, i, j, top;
while(~scanf("%d", &n)){
cin >> in >> out;
k = flag = i = j = top = ;
while(i < n){
if(top && s[top] == out[i]){
i++;
top--;
p[k++] = ;
}else if(j < n){
s[++top] = in[j++];
p[k++] = ;
}else{
flag = ;
break;
}
}
if(!flag){
printf("Yes.\n");
for(int i = ; i < k; i ++) printf("%s\n", p[i] == ? "in" : "out");
printf("FINISH\n");
}else printf("No.\nFINISH\n");
}
return ;
}

HDJ -- 1022的更多相关文章

  1. PAT A 1022. Digital Library (30)【结构体排序检索】

    https://www.patest.cn/contests/pat-a-practise/1022 直接模拟, 输入,按id排序,检索 #include <iostream> #incl ...

  2. HDU 1022 Train Problem I

    A - Train Problem I Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u ...

  3. Code[VS] 1022 覆盖 题解

    Code[VS] 1022 覆盖 题解  Hungary Algorithm 题目传送门:Code[VS] 1022 题目描述 Description 有一个N×M的单位方格中,其中有些方格是水塘,其 ...

  4. 1022. D进制的A+B (20)

    1022. D进制的A+B (20) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 输入两个非负10进制整数A和 ...

  5. Train Problem I hdu 1022(栈)

    http://acm.split.hdu.edu.cn/showproblem.php?pid=1022 题意:给出火车的进站与出站顺序,判断是否可以按照给出的出站顺序出站. #include < ...

  6. HDOJ 1022 模拟栈

    Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  7. hdu 1022 Train Problem I 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022 又是一道栈的练习,这次也是没有用到STL中的栈来实现.用来保存操作过程的数组(process[] ...

  8. 【wikioi】1022 覆盖(匈牙利)

    http://www.wikioi.com/problem/1022/ 好不容易来一次1A,,水题啊.. 染色后裸匈牙利orz #include <cstdio> #include < ...

  9. NBOJv2 1022 短信篮球(种类并查集)

    Problem 1022: 短信篮球 Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format:  %lld ...

随机推荐

  1. Prism for WPF 第一讲 Event机制

    在本篇文章中主要讲解在Prism中模块与模块之间事件关联的机制.在这里牵涉到三个名词:事件定义,事件发布,事件订阅. 第一:事件定义 在公共类库中定义事件. ①没有参数事件 public class ...

  2. 带缓冲的IO和不带缓冲的IO

    文件描述符: 文件描述符是一个小的非负整数,是内核用来标识特定进程正在访问的文件 标准输入/输出/出错: shell为每个程序打开了三个文件描述符,STDIN_FILEON,STDOUT_FILEON ...

  3. 配置php连接apache

    配置php连接apache 1.安装php所需要的库 yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel li ...

  4. Mock相关收集

    MockMVC+Mockito http://www.cnblogs.com/syxchina/p/4150879.html Spring中使用Mockito http://www.cnblogs.c ...

  5. 禁止选择文本和禁用右键 v3.0

    禁止选中字体(注:在火狐浏览器没有起到效果作用) <script> function disableselect(e) { var omitformtags = ["input& ...

  6. nslookup命令详解

    Nslookup 是一个监测网络中DNS服务器是否能正确实现域名解析的命令行工具.它在 Windows NT/2000/XP(在之后的windows系统也都可以用的,比如win7,win8等) 中均可 ...

  7. lucene 实现word,pdf全文检索源码

    创建索引: import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import jav ...

  8. php实例-正则获取网站音频地址的实例(Listen to this 1)

    主要用到了:file_get_contents();preg_match_all(); 这2个函数 查看地址:http://git.oschina.net/xiaoz6/phpExample

  9. BZOJ 1828: [Usaco2010 Mar]balloc 农场分配

    Description Input 第1行:两个用空格隔开的整数:N和M * 第2行到N+1行:第i+1行表示一个整数C_i * 第N+2到N+M+1行: 第i+N+1行表示2个整数 A_i和B_i ...

  10. BZOJ 1690: [Usaco2007 Dec]奶牛的旅行

    Description 作为对奶牛们辛勤工作的回报,Farmer John决定带她们去附近的大城市玩一天.旅行的前夜,奶牛们在兴奋地讨论如何最好地享受这难得的闲暇. 很幸运地,奶牛们找到了一张详细的城 ...