| ||||||||||
| 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 | |||||||||
TLE???#include<iostream>
#include<cstring>
using namespace std;
char a[100010],b[100010];//数组放函数内,会TLE
int main()
{
int i,la,lb,t;
while(scanf("%s %s",a,b)!=EOF)
{
t=0;
lb=strlen(b);
la=strlen(a);
for(i=0;i<lb;i++)
{
if(a[t]==b[i])
t++;
}
if(t==la)
printf("Yes\n");
else
printf("No\n");
}
system("pause");//去掉这句话为0ms,加上这句话为16ms
return 1;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator