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

如何降低内存啊?我的要200多k。请高手指点一下。

Posted by ycdoit at 2011-04-04 19:09:26 on Problem 1936
#include<cstdio>
using namespace std;
char fir[100001],sec[100001];
int fi,si;
int main()
{
	while(scanf("%s%s",fir,sec)==2)
	{
		fi=0,si=0;
		while(sec[si] && fir[fi]){
			if(fir[fi]==sec[si])	++fi,++si;
			else ++si;
		}
		if(fir[fi]==0)	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