2019/4/5团队训练赛(A)补题(C)

本文探讨了如何将一个字符串转化为超级回文字符串的最少步骤,并提供了样例输入和解题思路。此外,还介绍了Hakase和Nano玩鹅卵石游戏的规则,分析了在不同情况下两人的获胜策略,包括最优解和特殊情况的处理。
摘要由CSDN通过智能技术生成

问题 A: Super-palindrome

时间限制: 1 Sec  内存限制: 128 MB
提交: 490  解决: 169
[提交] [状态] [命题人:admin]

题目描述

You are given a string that is consisted of lowercase English alphabet. You are supposed to change it into a super-palindrome string in minimum steps. You can change one character in string to another letter per step.
A string is called a super-palindrome string if all its substrings with an odd length are palindrome strings. That is, for a string s, if its substring si...j satisfies j - i + 1 is odd then si+k = sj-k for k = 0,1,...,j-i+1.

 

输入

The fi rst line contains an integer T (1≤T≤100) representing the number of test cases.
For each test case, the only line contains a string, which consists of only lowercase letters. It is guaranteed that the length of string satisfies 1≤|s|≤100.

 

输出

For each test case, print one line with an integer refers to the minimum steps to take.

 

样例输入

复制样例数据

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值