Test instructions
Give s,t two strings, you can choose to add a character after a character in the S string indefinitely, but the added character cannot be the same as the selected character, ask if the S string can become a T-string.
Ideas:
It was observed that if S is the same as the T length, it is directly sentenced.
If it's not the same, just meet
1. The order of all the characters in S is in the T-string.
2. The same character in front of T and the first part of S can match
Here are two conditions that can be constituted.
Code:
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <
algorithm> #include <iostream> #include <stack> using namespace std;
#define LL __int64 Char x[123456],y[123456];
int main () {int t;
cin>>t;
while (t--) {scanf ("%s%s", X, y);
int A, B;
A=strlen (x);
B=strlen (y);
int f=1;
if (a==b) {if (strcmp (x, y) ==0) f=1;
else f=0;
} else {int i,j;
for (i=1;i<b;i++) if (y[i]!=y[i-1]) break;
for (j=0;j<i;j++) {if (x[j]!=y[j]) break;
} if (j!=i) f=0;
if (f) {int cnt=a-i; for (; i<a;i++) {for (; j<b;j++) {if (x
[I]==y[j]) {cnt--; Break
}}} if (cnt==0) f=1;
else f=0; }} puts (F==1? ")
Yes ":" No ");
} return 0;
}