暴力模拟。。好好读题就好了。。羡慕英语好的
#includeusing namespace std;typedef long long LL;bool vis[150];string t;string p,p1;int q;bool ok(string t){ if(t.length() p.length(); l++) if(vis[t[i+l]]) return false; } else return false; } if(t.length()-l+1!=p.length()) return false; return true; }}int main(){ while(cin>>t) { memset(vis,0,sizeof(vis)); p1.clear(); for(int i=0; i >p; for(int i=0; i >q; while(q--) { cin>>t; if(ok(t)) puts("YES"); else puts("NO"); } }}