Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

TLE???

Posted by aidudu at 2011-02-15 16:33:43 on Problem 1936
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator