#P7586. NUMOFPAL - Number of Palindromes

NUMOFPAL - Number of Palindromes

NUMOFPAL - Number of Palindromes

  • 时间限制:1 秒
  • 内存限制:64 MiB

题目描述

给定一个字符串 SS,求其中回文子串的总出现次数。单个字符也视为回文串。

相同内容的回文串如果出现在不同位置,需要分别计数。

输入格式

输入一行一个仅包含小写英文字母的非空字符串 SS。

输出格式

输出一个整数,表示 SS 中回文子串的出现次数。

样例输入 1

malayalam

样例输出 1

15

数据范围

对于所有测试数据,保证:

  • 1≤∣S∣≤10001\le \lvert S\rvert\le1000。
测试点编号 分值 特殊限制
1∼61\sim6 3030(捆绑) ∣S∣≤20\lvert S\rvert\le20
7∼107\sim10 ∣S∣≤300\lvert S\rvert\le300
11∼1611\sim16 4040(捆绑) 无

同一子任务的测试点全部通过才能获得该子任务的分值。