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

我的16ms啊,怎么搞成0ms 啊。我实在是想不到

Posted by liushengbing at 2010-05-28 16:45:59 on Problem 1936

#include <stdio.h>

char s[100001];
char t[100001];



bool s_in_t( char *s ,char *t)
{
	for ( ; *s ; s++)
	{
		for ( ; *t && *s != *t ; t++);
		if ( !*t)
			break;
		else 
			t++;
	}
	if ( *s )
	{
		return false;
	}

	return true;
}


int main(void)
{
	while ( scanf("%s%s" , s ,t) != EOF )
	{
		if (s_in_t( s , t ))
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}

	return 0;
}

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