#include<iostream>
#include<stack>
#include<string>
using namespace std;
int main()
{
int n;
string o1,o2;
while(cin>>n>>o2>>o1){
stack<char> s;
string str="1";
s.push(o2[0]);
int i=0,j=0;
while(i<n&&j<n)
{
if(s.size()&&s.top()==o1[j])
{
s.pop();str+="0";j++;
}else{
s.push(o2[++i]);
str+="1";
}
}
if(i==n)cout<<"No.\n"<<"FINISH"<<endl;
else{
cout<<"Yes."<<endl;
for(char s:str){
if(s=='0')cout<<"out"<<endl;
else cout<<"in"<<endl;
}
cout<<"FINISH"<<endl;
}
}
return 0;
}
86.hdu--1022--Train Problem I
最新推荐文章于 2021-07-14 21:12:43 发布