帮忙看看哪错了
在OJ上提交,Runtime Error
为什么会RE啊? 在自己电脑上运行都好好的.
题目可以使用的内存: Memory Limit : 32768 KB
#include<iostream>#include<string>using namespace std;char s[1000000],c[1000000];int main(){ int t,tmp,len; char *pts,*ptc,*p; while(scanf("%s",s)!=EOF&&strcmp(s,".")!=0) { t=1; c[0]=s[0]; pts=s; ptc=c;p=s; len=strlen(s); while(1) { if(len%t!=0){c[t]=s[t];t++;pts=s;continue;} tmp=strncmp(ptc,pts,t); if(tmp!=0) { c[t]=s[t]; t++; pts=s; continue; } pts+=t; if(pts-p==len) break; //if(*pts==0)break; } cout<<len/t<<endl; } return 0;}