1 #include"iostream" 2 #include"stdio.h" 3 #include"string.h" 4 #include"vector" 5 using namespace std; 6 7 const int MAXN=100005; 8 9 pairfun(const string &str)10 {11 vector subs;12 int maxcount=1,count=1;13 string substr;14 int i,len=str.length();15 for(i=0;i maxcount)35 {36 maxcount=count;37 }38 }39 }40 }41 return make_pair(maxcount,substr);42 }43 44 pair fun1(const string& str)45 {46 int maxcount=1,count=1;47 string substr;48 int i=0,j=0;49 int len=str.length();50 int k=i+1;51 while(i (len+i)/2)55 {56 i++;57 k=i+1;58 }59 else60 {61 int s=i;62 int s1=j-i;63 while(str.substr(s,s1)==str.substr(j,s1))64 {65 count++;66 s=j;67 j=j+s1;68 }69 if(count>maxcount)70 {71 maxcount=count;72 substr=str.substr(i,s1);73 }74 k=j+1;75 count=1;76 }77 }78 return make_pair(maxcount,substr);79 }80 81 int main()82 {83 string str;84 pair rs;85 while(cin>>str)86 {87 rs=fun(str);88 cout< <<":"< <