#abc320b. B - Longest Palindrome

B - Longest Palindrome

Score : 200200 points

问题描述

你将得到一个字符串 SS。请找出 SS 中最长的连续回文子串的长度。

注意:SS 总存在至少一个连续的回文子串。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a string SS. Find the maximum length of a contiguous substring of SS that is a palindrome.
Note that there is always a contiguous substring of SS that is a palindrome.

Constraints

  • SS is a string of length between 22 and 100100, inclusive, consisting of uppercase English letters.

Input

The input is given from Standard Input in the following format:

SS

Output

Print the answer.

Sample Input 1

TOYOTA

Sample Output 1

5

TOYOT, a contiguous substring of TOYOTA, is a palindrome of length 55.
TOYOTA, the only length-66 contiguous substring of TOYOTA, is not a palindrome, so print 55.

Sample Input 2

ABCDEFG

Sample Output 2

1

Every contiguous substring of length 11 is a palindrome.

Sample Input 3

AAAAAAAAAA

Sample Output 3

10

update @ 2024/3/10 01:38:13

}