#B. 回文字串

    Type: Default 1000ms 256MiB

回文字串

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

luogu P1435

2022-2023春季学期初一信息竞赛组期中考第二题

Description

小A很喜欢回文串,他想将自己见到的一个字符串s变成回文串,但他只能向这个串里添加字母。给定字符串s,问小A至少需要添加多少个字母才能让它变成回文串。

注:此问题区分大小写

Format

Input

输入只有一行为一个字符串。

Output

一个正整数表示最少要添加的字符数量。

Samples

Ab3bd
2

Limitation

30%30\%的数据,length(s)100length(s)≤100

100%100\%的数据,length(s)5103length(s)≤5*10^3

2024~2025第二学期初一竞赛组期末考

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2025-6-9 14:30
End at
2025-6-13 10:30
Duration
1.5 hour(s)
Host
Partic.
21