#include <iostream>
#include <algorithm>
#include <stdio.h>
#include<map>
using namespace std;
map<string,int>num;
int main()
{
string s,name;
int i,j,k,n;
cin>>s;
n=s.size();
for(k=1; k<=n; k++)
{
for(i=0; i+k<=n; i++)
{
name="";
for(j=i; j<i+k; j++)
{
name=name+s[j];
}
num[name]++;
if(num[name]>1) break;
}
if(i+k>n) break;
}
cout<<k-1<<endl;
return 0;
}
CodeForces 23A-You're Given a String...
最新推荐文章于 2022-10-17 15:28:44 发布