Reprinted please indicate the source: Thank you
Http://user.qzone.qq.com/289065406/blog/1300626728
Find the child string of S1 in S2. I still wanted to use LCS. Later I thought about it. This would consume too much space, and it would be troublesome to use a rolling array... After all, the maximum number of columns is 10 W = so I still forget it, directly simulate faster =
Conclusion: let alone the water question. \ (^ o ^ )/~
Note that the subscript range of Int Is less than. I use long
// Memory time // 364 K 0 Ms # include <iostream> # include <string> using namespace STD; int main (long I, long J) {char S1 [100000], s2 [100000]; while (CIN> S1> S2) {long len1 = strlen (S1); long len2 = strlen (S2); I = 0; j = 0; while (true) {if (I = len1) {cout <"yes" <Endl; break;} else if (I <len1 & J = len2) {cout <"no" <Endl; break;} If (S1 [I] = S2 [J]) {I ++; j ++ ;} elsej ++;} memset (S1, '\ 0', sizeof (S1); memset (S2,' \ 0', sizeof (S2);} return 0 ;}