STL的应用
#include<cstdio>
#include<cmath>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
const int Max_n=100005;
typedef long long LL;
int main(){
string a;
int n;
cin>>a>>n;
getchar();
while(n--){
string b;
cin>>b;
bool flag=true;
int len=b.length();
size_t index=a.find(b[0]);//先找到第一个位置.
if(index==a.npos){
cout<<"No"<<endl;
continue;
}
for(int i=1;i<len;i++){
index=a.find(b[i],index+1);
if(index==a.npos){
flag=false;
break;
}
}
if(flag) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}