特殊类型:回文串
文章平均质量分 78
论菜鸟的自我修养
凡事不能将我们毁灭,必使我们更强大
展开
-
codeforces Round 286# problem A. Mr. Kitayuta's Gift < 回文串 >
题目:http://codeforces.com/contest/505/problem/A A. Mr. Kitayuta's Gift time limit per test 1 second memory limit per test 256 megabytes input standard input output原创 2016-07-26 10:16:08 · 275 阅读 · 0 评论 -
插入最少的字符使字符串成为回文串 <最长公共子序列 + 回文>
题目描述 给定一个字符串S,可以通过在字符串的任意位置插入字符,使其变为回文串。求最少插入字符的数量。 例如: ab -> bab 1 aa -> aa 0 abca -> acbca 1 题目来源:微信号 待字闺中 解题思路 如果能在原串S中找到最长的子序列L,这个子序列是回文,那么我们就能知道要插入多少个字符是的原串成原创 2016-07-26 13:39:04 · 2384 阅读 · 0 评论 -
CODEFORCES 501E Misha and Palindrome Degree <回文串 + 构成回文串的种数>
传送门:http://codeforces.com/problemset/problem/501/E 题意:给你n个数字a0,a2,...,an-1。(1 分析:列举每种可能匹配的情况,分奇偶,注意中间位置 考虑周全就行了。。。。。代码如下: #include using namespace std; const int maxn = 100005; int a[maxn],b[max原创 2016-07-29 18:58:02 · 799 阅读 · 0 评论