题目链接:https://vjudge.net/problem/SPOJ-REPEATS REPEATS - Repeats no tags A string s is called an (k,l)-repeat if s is obtained by concatenating k>1 times some seed string t with length l>1. For example, the string s abaabaabaaba is a (…
思路:首先我们要枚举长度,然后从前往后遍历,判断是否存在改长度的重复串。
代码:
void solve(){string s;cin >> s;int n s.size();int ans 0;for(int len n / 2;len > 1;len --){int t 0;for(int i 0;i len <…