#include using namespace std; /* qiuchangdu(string s) 字符串长度是奇数 返回 字符串长度 否则 判断是否是对称的 如果是对称的,则返回 qiuchangdu(字符串s的一半) 否则 返回 字符串长度 */ int qiuchangdu(string s) { if (s.length() % 2 == 1) { return s.length(); } else { string temp = s; reverse(temp.begin(), temp.end()); if (s == temp) return qiuchangdu(s.substr(0, s.length() / 2)); else return s.length(); } } int main() { string s; cin >> s; cout << qiuchangdu(s) << endl; return 0; }