logo AlgoBeat OnlineJudge
登录 注册

#103103. [BZOJ 3103] Palindromic Equivalence

内存限制:128 MiB 时间限制:10000 ms 标准输入输出
题目类型:传统 评测方式:文本比较
上传者: 匿名

题目描述

给出一个由小写字母组成的字符串 ,问有多少由小写字母构成的字条串 ,满足:

  1. ;
  2. 是回文串,当且仅当 是回文串。

输入格式

一个字符串 。

输出格式

输出答案 。

样例

样例输入 #1

abba

样例输出 #1

650

样例说明

Only words of the form xyyx are palindromically equivalent to abba, where x and y are distinct letters. The English alphabet contains letters, consequently there are such words in total.

数据范围与提示

对于 的数据, 长度 。