HDUOJ Train Problem I
来源:互联网 发布:sql合并相同行 编辑:程序博客网 时间:2024/06/15 13:00
#include<stdio.h>#include<string.h>#include<stack>using namespace std;stack<char> str;char s1[9],s2[9];int main(){ int n; str.push('#'); while(~scanf("%d %s %s",&n,s1,s2)) { while(str.top()!='#') str.pop(); int l=0,i; for(i=0;i<n;i++) { str.push(s1[i]); if(str.top()==s2[l]) { while(str.top()==s2[l]) { str.pop(); l++; } } } if(str.top()=='#') { printf("Yes.\n"); l=0; for(i=0;i<n;i++) { if(str.top()!=s2[l]) { str.push(s1[i]); printf("in\n"); if(str.top()==s2[l]) { while(str.top()==s2[l]) { str.pop(); printf("out\n"); l++; } } } } printf("FINISH\n"); } else printf("No.\nFINISH\n"); } return 0;}
0 0
- HDUOJ Train Problem I
- hduoj Train Problem I-1022
- HDUoj 1022 Train Problem I ( 栈
- HDUOJ 1023 Train Problem II
- 1022 Train Problem I
- HDU1022 Train Problem I
- Train Problem I
- 1022:Train Problem I
- 1022 Train Problem I
- HDU1022 Train Problem I
- Train Problem I
- HDU1022:Train Problem I
- HDU1022--Train Problem I
- Train Problem I
- hdu1022-Train Problem I
- HDU1022 Train Problem I
- hdu1022 Train Problem I
- Train Problem I
- 一些工具类
- 在64位ubuntu上编译kitkat4.4时遇到HashSet_jni.h错误导致编译中止的问题
- 1031. Hello World for U (20)
- 【登录异常解决】Ubuntu 输入正确的密码后重新返回到登陆界面
- shell内部命令-----变量类
- HDUOJ Train Problem I
- 【POJ3181】【Dollar Dayz】
- 子集生成
- 过滤器参考
- 【转】【阮一峰】为什么Lisp语言如此先进?(译文)
- dlopen 方式调用 Linux 的动态链接库
- 黑马程序员——面向对象(多态,内部类、异常、包)
- synchronized 与 Lock 对比
- 监听器参考实例