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 LCL_data at 2007-08-14 16:42:15 on Problem 1936
#include<stdio.h>
#include<string.h>
char s[100005],t[100005];
void main()
{
    int i,j,k,mark;
	while(scanf("%s%s",s,t)==2)
	{
		k=0;mark=0;
		for(i=0;i<strlen(s);i++)
		{

		  
			 for(j=k;j<strlen(t);j++)
			{
				if(s[i]==t[j])
				{
					k=j+1;
					break;
				}
			}
			if(j>=strlen(t))
			{
			    mark=1;
				printf("No\n");
				break;
			}

		}
      if(mark==0)
	   	printf("Yes\n");

	}
}

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