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 |
如何降低内存啊?我的要200多k。请高手指点一下。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator