| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么超时#include"stdio.h"
#include"string.h"
int main()
{
char a[100001],b[100001];
while(scanf("%s%s",&a,&b)>0)
{
int i=0,j,k=0,m=0;
j=strlen(a);
if(strlen(a)>strlen(b))
{
printf("No\n");
continue;
}
else
{
while(i<strlen(b))
{
if(a[k]==b[i])
{
++m;
if(m==j)
{
printf("Yes\n");
break;
}
++k;
if(k==j)
{
break;
}
}
++i;
}
if(m!=j)
printf("No\n");
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator