#P1435. [IOI 2000] 回文字串
[IOI 2000] 回文字串
Description
A palindrome is a symmetric string. For any given string, by inserting some characters, it can be turned into a palindrome. The task is to find the minimum number of characters that need to be inserted to make the given string a palindrome.
For example, can become a palindrome after inserting characters, such as or , but it cannot become a palindrome with fewer than insertions.
Note: This problem is case-sensitive.
Input Format
The input consists of one line containing a string.
Output Format
Output a single integer: the minimum number of inserted characters.
Ab3bd
2
Hint
Constraints
Let the length of the string be .
For all testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号