Codeforces Round #208 (Div. 2) B Dima and Text Messages

时间:2023-03-08 17:45:10
 #include <iostream>
#include <algorithm>
#include <string> using namespace std; int main(){
int n;
cin >> n;
string words = "<3",tmp;
for(int i = ; i < n ; ++ i){
cin >> tmp;
words +=tmp+"<3";
}
string message;
cin >> message;
if(message.length() < words.length()) cout<<"no"<<endl;
else{
int k = ;
for(int i = ; i < words.length();){
while(k< message.length() && message[k]!=words[i]) k++;
if(k >= message.length()){cout<<"no"<<endl; return ;}
else ++i;
}
cout<<"yes"<<endl;
}
}