标签:mis 序列 amp 元素 mina jpg ace space school
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 51329 Accepted Submission(s): 19314
#include<iostream> #include<string.h> #include<queue> #include<stack> using namespace std; stack<char>a; int main() { int n; int vis[10]; char s[10],ss[10]; while(cin>>n>>s>>ss&&n) { int j=0,k=0; for(int i=0;i<n;i++) { a.push(s[i]); vis[k++]=1; while(!a.empty()&&a.top()==ss[j]) { vis[k++]=0; a.pop(); j++; } } if(a.empty()) { cout<<"Yes."<<endl; for(int i=0;i<k;i++) { if(vis[i]==1) cout<<"in"<<endl; else cout<<"out"<<endl; } cout<<"FINISH"<<endl; } else { cout<<"No."<<endl; cout<<"FINISH"<<endl; } while(!a.empty()) a.pop(); } return 0; }
标签:mis 序列 amp 元素 mina jpg ace space school
原文地址:https://www.cnblogs.com/-citywall123/p/10540466.html