给定一个由字母 'a' 和 'b' 组成的字符串。我们定义一个子串的“出现价值”为该子串在原字符串中出现的次数乘以该子串的长度。对于给定的字符串,求出所有回文子串中最大的出现价值。
输入格式
输入仅一行,包含一个长度为 $n$ 的非空字符串 ($1 \le n \le 5\,000\,000$)。
输出格式
输出一个整数,表示回文子串的最大出现价值。
样例
输入 1
aaa
输出 1
4
给定一个由字母 'a' 和 'b' 组成的字符串。我们定义一个子串的“出现价值”为该子串在原字符串中出现的次数乘以该子串的长度。对于给定的字符串,求出所有回文子串中最大的出现价值。
输入仅一行,包含一个长度为 $n$ 的非空字符串 ($1 \le n \le 5\,000\,000$)。
输出一个整数,表示回文子串的最大出现价值。
aaa
4
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: