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。。。暴搜。。。TLE我就认了,RE很奇怪啊 #include<iostream> #include<cstdio> #include<cstring> using namespace std; bool mysubstr(char *s,char *s0) { int i=0,len=strlen(s); if(len>60)return 0; for(i=0;i<len;i++) { if(s[i]!=s0[i])return 0; } return 1; } int main() { int m,n,i,j,cnt=0; char dict[1000][100],s[10000]; scanf("%d%d",&m,&n); getchar(); for(i=0;i<m;i++)gets(dict[i]); for(i=0;i<n;i++) { memset(s,0,sizeof(s)); gets(s); j=0; while(mysubstr(s,dict[j])==0)j++; if(j<m)cnt++; } printf("%d\n",cnt); //system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator