https://codeforces.com/group/vFwRVj9WjO/contest/326585/problem/B
第一次,被回文绕晕了
第二次
如果串由一个字母组成,输出-1
如果有两个(或两个以上)子串不一样,输出2
#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
int main()
{
ios;
string str;
cin >> str;
char a = str[0];
rep(i,0,str.length()-1)
{
if(str[i] != a)
{
cout << 2;
return 0;
}
}
cout << -1;
}