QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 524288 MB Puntuación total: 100 Hackeable ✓

#13233. 回文副歌

Estadísticas

给定一个由字母 'a' 和 'b' 组成的字符串。我们定义一个子串的“出现价值”为该子串在原字符串中出现的次数乘以该子串的长度。对于给定的字符串,求出所有回文子串中最大的出现价值。

输入格式

输入仅一行,包含一个长度为 $n$ 的非空字符串 ($1 \le n \le 5\,000\,000$)。

输出格式

输出一个整数,表示回文子串的最大出现价值。

样例

输入 1

aaa

输出 1

4

Discussions

About Discussions

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.

Open Discussions 0
No discussions in this category.

Issues

About Issues

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:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.