题目:
http://39.106.164.46/problem.php?id=1136
代码如下:
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<queue>
#include<cstring>
#include<vector>
#include<stack>
#include<map>
#include<set>
#define MAX 105
#define INF 0x3f3f3f3f
typedef long long ll;
using namespace std;string s;int main(){
int t;cin>>t;while(t--){
cin>>s;int len=s.length();int ans;for(int l=1;l<len;l++){
bool flag=true;for(int i=0;i<len-l;i++){
if(s[i]!=s[i+l]){
flag=false;break;}}if(flag){
ans=l;break;}}cout<<ans<<endl<<endl;}return 0;
}