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 |
为何啊,为何会是WA?for(ps=s,ii=0,pt=t; (ii<len_s)&&(pt=strchr(pt,*ps));ii++,ps++)/*pku 1936 All in All 051213 */ /* s is a subsequence of t*/ #define N 100000 #include<stdio.h> #include<string.h> int main() { char s[N],t[N]; long ii; char *p1,*ps,*pt; long len_s; for(;scanf("%s%s",s,t)!=EOF;) { len_s=strlen(s); for(ps=s,ii=0,pt=t; (ii<len_s)&&(pt=strchr(pt,*ps));ii++,ps++) /* printf("%c %c",*pt,*ps);*/; if(ii==len_s) printf("Yes\n"); else printf("No\n"); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator