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 |
请教大牛怎么这个程序是RE呢?#include<stdio.h> #include<string.h> char a[100005],b[100005],z[100005][10005]; int main() { int la,lb,i,j; while(scanf("%s%s",a+1,b+1)) { la=strlen(a+1); lb=strlen(b+1); memset(z,0,sizeof(z)); for(i=1;i<=la;i++) for(j=1;j<=lb;j++) { if(a[i]==b[j]) z[i][j]=z[i-1][j-1]+1; else { if(z[i][j-1]>z[i-1][j]) z[i][j]=z[i][j-1]; else z[i][j]=z[i-1][j]; } } if(z[la][lb]==la) 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