시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 3 | 2 | 2 | 66.667% |
You just finished day one of your alchemy class! For your alchemy homework, you have been given a string of lowercase letters and wish to make it a palindrome. You're only a beginner at alchemy though, so your powers are limited. In a single operation, you may choose exactly two adjacent letters and change each of them into a different lowercase letter. The resulting characters may be the same as or different from one another, so long as they were both changed by the operation.
Formally, if the string before the operation is $s$ and you chose to change characters $s_i$ and $s_{i+1}$ to produce string $t$, then $s_i \neq t_i$ and $s_{i+1} \neq t_{i+1}$ must be true, but $t_i = t_{i+1}$ is permitted.
Compute the minimum number of operations needed to make the string a palindrome.
The single line of input contains a string of $n$ $(2 \le n \le 100)$ lowercase letters, the string you are converting into a palindrome.
Output a single integer, which is the minimum number of operations needed to make the string a palindrome.
ioi
0
noi
1
ctsc
1
fool
2
vetted
2
ICPC > Regionals > North America > Mid-Atlantic Regional > 2022 Mid-Atlantic USA Regional Contest > Division 1 M번
ICPC > Regionals > North America > South Central USA Regional > 2022 South Central USA Regional Contest > Division 1 M번
ICPC > Regionals > North America > Southeast USA Regional > 2022 Southeast USA Regional Programming Contest > Division 1 M번
ICPC > Regionals > North America > Mid-Atlantic Regional > 2022 Mid-Atlantic USA Regional Contest > Division 2 M번
ICPC > Regionals > North America > South Central USA Regional > 2022 South Central USA Regional Contest > Division 2 M번
ICPC > Regionals > North America > Southeast USA Regional > 2022 Southeast USA Regional Programming Contest > Division 2 M번
ICPC > Regionals > North America > Pacific Northwest Regional > 2022 ICPC Pacific Northwest Region > Division 1 B번
ICPC > Regionals > North America > Pacific Northwest Regional > 2022 ICPC Pacific Northwest Region > Division 2 B번