代码wrong answer UVa 10340
这个代码总是提交时wrong answer,各位帮忙看看,谢谢啦UVa 10340 https://
#include<stdio.h>
#include<string.h>
const int maxn = 100010;
char s[maxn],t[maxn];
int main()
{
//freopen("3-9.txt","r",stdin);
while(scanf("%s%s",s,t) != EOF)
{
int sl = strlen(s),tl = strlen(t),k = 1;
if(sl >= tl)
{
if(!strcmp(s,t))
printf("Yes\n");
else printf("No\n");
}
else
{
for(int i = 0; i < sl; i++)
{
if(strchr(t,s[i])) continue;
k = 0;
break;
}
if(k == 0) printf("No\n");
else
{
int sum = 0, m = 0, n = 0;
for(int i = n; i < sl; i++)
for(int j = m; j < tl; j++)
{
if(s[i] == t[j])
{
sum++;
m = j;
n = i;
break;
}
}
if(sum == sl)
printf("Yes\n");
else printf("No\n");
}
}
}
return 0;
}