#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define ll long long
#define ld long double
#define mp make_pair
const int N=3e5+50;
int n;
string s;
map<string,ll>mapa;
int main(){
cin>>s;
n=s.size();
for(int i=0;i<n;i++){
string temp;
for(int j=i;j<n;j++){
temp.pb(s[j]);
mapa[temp]++;
}
}
ll res=0;
for(auto [s,x]:mapa) res=max(res,(ll)s.size()*x);
//for(auto [s,x]:mapa) cout<<s<<" "<<x<<"\n";
printf("%lld\n",res);
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |