青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 21, comments - 2, trackbacks - 0, articles - 0
題目地址: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 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 下面是代碼,第一次使用C++的STL模板,用的很不熟練,不過沒想到1Y就過了~~~YY。。。
#include<cstdio>
#include
<stack>
using namespace std;
int main()
{
    
int i,j,k,n,ok,flg[22];
    
char in[10],out[10];
    
while(scanf("%d",&n)!=EOF)
    
{
        scanf(
"%s%s",in,out);
        stack
<int> s;
        i
=j=k=0;ok=1;
        
while(j<n)
        
{
            
if(in[i]==out[j])
            
{
                flg[k
++]=0;flg[k++]=1;i++;j++;
            }

            
else if(!s.empty() && s.top()==(out[j]-'0'))
            
{
                flg[k
++]=1;s.pop();j++;
            }

            
else if(i<n)
            
{
                s.push(
in[i++]-'0');flg[k++]=0;
            }

            
else 
            
{
                ok
=0;break;
            }

        }

        
if(ok==0)printf("No.\n");
        
else
        
{
            printf(
"Yes.\n");
            
for(i=0;i<k;i++)
            
{
                
if(flg[i]==0)printf("in\n");
                
else printf("out\n");
            }

        }

        printf(
"FINISH\n");
    }

    
return 0;
}


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲激情黄色| 欧美 亚欧 日韩视频在线| 欧美日本高清| 国产精品99久久久久久宅男| 亚洲高清二区| 欧美激情一区二区三区不卡| 99国内精品| 亚洲一区二区视频| 国产欧美日韩一区二区三区| 久久久中精品2020中文| 久久久久久婷| 亚洲精选久久| 香蕉乱码成人久久天堂爱免费| 黑丝一区二区三区| 欧美成人免费在线观看| 欧美另类综合| 久久久久久久综合日本| 欧美不卡视频一区| 亚洲欧美日韩在线不卡| 欧美中文字幕第一页| 亚洲精品久久久久久久久| av不卡在线| 伊人久久大香线| av不卡在线看| 精品成人一区二区| 亚洲作爱视频| 激情视频一区二区| 一区二区三区久久久| 一区二区在线观看av| 日韩亚洲精品电影| 最新亚洲视频| 国产日本欧美一区二区| 亚洲电影在线免费观看| 国产精品综合av一区二区国产馆| 免费在线播放第一区高清av| 欧美日韩一卡二卡| 欧美大片一区二区| 国产欧美va欧美不卡在线| 亚洲人成7777| 有码中文亚洲精品| 亚洲综合精品自拍| 国产精品中文字幕欧美| 亚洲第一网站免费视频| 国产亚洲欧洲997久久综合| 亚洲免费观看| 亚洲高清久久网| 欧美一级免费视频| 午夜亚洲福利| 午夜免费电影一区在线观看| 亚洲天堂av在线免费观看| 免费成人黄色| 久久在线精品| 韩国精品久久久999| 亚洲资源在线观看| 亚洲综合日韩| 国产精品porn| 夜夜嗨av一区二区三区| 一区二区三区日韩在线观看 | 久久精品二区亚洲w码| 欧美日韩裸体免费视频| 亚洲国产精品成人综合| 亚洲日韩视频| 久久香蕉国产线看观看av| 久久午夜精品| 亚洲大片一区二区三区| 久久久九九九九| 麻豆精品网站| 欧美日韩国产精品一区二区亚洲| 久久成人综合网| 国产精品永久在线| 小嫩嫩精品导航| 久久久久久久成人| 伊人久久噜噜噜躁狠狠躁| 欧美一区二区三区在线| 久久尤物视频| 亚洲国产精品尤物yw在线观看| 久久永久免费| 99视频精品在线| 午夜精品久久久久99热蜜桃导演| 国产精品视屏| 亚洲理论在线观看| 亚洲女同精品视频| 国产日韩欧美三级| 久久久久国产精品厨房| 亚洲国产欧美一区二区三区久久| 亚洲蜜桃精久久久久久久| 欧美日韩国产成人高清视频| 亚洲一区二区在线免费观看| 久久精品在线播放| 91久久久亚洲精品| 欧美色精品天天在线观看视频| 亚洲天堂成人在线视频| 久久久亚洲国产天美传媒修理工| 亚洲丰满在线| 国产精品国产三级国产| 久久久久久一区二区| 99国产精品99久久久久久粉嫩| 欧美在线一区二区| 日韩亚洲在线观看| 国产精品视频久久| 欧美sm视频| 亚洲制服av| 亚洲精品久久嫩草网站秘色| 久久成人免费网| 99伊人成综合| 国内外成人在线| 欧美日韩精品免费看| 久久狠狠一本精品综合网| 日韩午夜在线电影| 美日韩丰满少妇在线观看| 亚洲午夜伦理| 亚洲国语精品自产拍在线观看| 欧美无砖砖区免费| 久久人人97超碰人人澡爱香蕉 | 欧美制服丝袜第一页| 亚洲精品日产精品乱码不卡| 国产一区二区三区网站| 欧美日韩视频一区二区| 久久综合五月| 午夜精品一区二区三区四区| 夜夜精品视频| 亚洲国产小视频| 免费亚洲视频| 久久超碰97人人做人人爱| 亚洲视频电影图片偷拍一区| 在线看片成人| 精品盗摄一区二区三区| 国产视频亚洲精品| 国产农村妇女毛片精品久久麻豆 | 中文网丁香综合网| 99精品热视频只有精品10| 欧美激情亚洲自拍| 免费中文字幕日韩欧美| 久久久夜夜夜| 久久亚洲一区二区| 久久精品亚洲| 久久成人国产精品| 久久精品99国产精品| 性亚洲最疯狂xxxx高清| 亚洲影视在线播放| 亚洲一区二区三区激情| 在线亚洲一区观看| 一区二区三区www| 一本久久知道综合久久| 一本色道久久综合亚洲91| 亚洲免费观看视频| 99伊人成综合| 亚洲自拍偷拍色片视频| 亚洲一区二区在| 亚洲一区二区三区四区中文 | 亚洲福利视频一区| 亚洲人成网站999久久久综合| 在线欧美日韩| 亚洲日本中文字幕| 一本在线高清不卡dvd| 亚洲视频第一页| 欧美在线播放一区| 免费国产自线拍一欧美视频| 欧美黄色免费网站| 亚洲精品视频中文字幕| 亚洲香蕉成视频在线观看| 亚洲欧美在线一区二区| 久久久久久尹人网香蕉| 欧美激情第二页| 国产精品视频99| 伊伊综合在线| 中日韩午夜理伦电影免费| 亚洲综合视频在线| 久久综合五月| 91久久综合亚洲鲁鲁五月天| 亚洲午夜一二三区视频| 欧美影院在线播放| 欧美成人网在线| 欧美性色aⅴ视频一区日韩精品| 国产日韩欧美三级| 最近中文字幕mv在线一区二区三区四区 | 欧美高清在线视频| 国产精品久久久久久久第一福利| 国产亚洲成av人片在线观看桃| 好看的日韩视频| 一区二区三区欧美激情| 久久综合九色欧美综合狠狠| 亚洲美女黄色片| 久久精品视频导航| 欧美午夜一区二区三区免费大片 | 亚洲人成网站影音先锋播放| 西西人体一区二区| 亚洲大片在线观看| 午夜一级久久| 欧美日韩亚洲三区| 亚洲丰满在线| 久久精品一区二区三区中文字幕| 亚洲国产一区二区三区高清| 午夜精品一区二区三区在线播放| 免费看的黄色欧美网站| 国产一区二区三区免费观看 | 国产视频精品va久久久久久| 一本在线高清不卡dvd| 欧美成va人片在线观看| 亚洲欧美另类久久久精品2019|