#P10170. [DTCPC 2024] 小方和小立方
[DTCPC 2024] 小方和小立方
Background
Xiao Fang does not want to become Xiao Cube.
Problem Description
You are given a string consisting of lowercase letters. Find how many intervals satisfy that the substring represented by this interval is a palindrome, and the number of occurrences of each character does not exceed .
Input Format
One line contains a string ().
Output Format
One line contains one number, which is the answer.
ababa
8
Hint
Translated by ChatGPT 5