#abc320b. B - Longest Palindrome
B - Longest Palindrome
Score : points
问题描述
你将得到一个字符串 。请找出 中最长的连续回文子串的长度。
注意: 总存在至少一个连续的回文子串。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string . Find the maximum length of a contiguous substring of that is a palindrome.
Note that there is always a contiguous substring of that is a palindrome.
Constraints
- is a string of length between and , inclusive, consisting of uppercase English letters.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
TOYOTA
Sample Output 1
5
TOYOT
, a contiguous substring of TOYOTA
, is a palindrome of length .
TOYOTA
, the only length- contiguous substring of TOYOTA
, is not a palindrome, so print .
Sample Input 2
ABCDEFG
Sample Output 2
1
Every contiguous substring of length is a palindrome.
Sample Input 3
AAAAAAAAAA
Sample Output 3
10
update @ 2024/3/10 01:38:13