Give a string SSS and NNN string TiT_iTi , determine whether TiT_iTi is a subsequence of SSS.
If ti is subsequence of SSS, print YES,else print NO.
If there is an array {K1,K2,K3,⋯ ,Km}\lbrace K_1, K_2, K_3,\cdots, K_m \rbrace{K1,K2,K3,⋯,Km} so that 1≤K1<K2<K3<⋯<Km≤N1 \le K_1 < K_2 < K_3 < \cdots < K_m \le N1≤K1<K2<K3<⋯<Km≤N and Ski=TiS_{k_i} = T_iSki=Ti, (1≤i≤m)(1 \le i \le m)(1≤i≤m), then TiT_iTi is a subsequence of SSS.
The first line is one string SSS,length(SSS) ≤100000 \le 100000≤100000
The second line is one positive integer N,N≤100000N,N \le 100000N,N≤100000
Then next nnn lines,every line is a string TiT_iTi, length(TiT_iTi) ≤1000\le 1000≤1000
Print NNN lines. If the iii-th TiT_iTi is subsequence of SSS, print YES, else print NO.
转载于:https://www.cnblogs.com/RootVount/p/10752507.html