首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
POJ1159Palindrome
】的更多相关文章
POJ1159Palindrome
http://poj.org/problem?id=1159 题意 : 给定一个字符串,问最少插入多少字符,使该字符串变成回文串 思路 : 设原字符串序为X,逆序列为Y,则最少需要补充的字母数 = X的len减去X和Y的最长公共子序列的长度,又是一个动态规划问题,这个题的数据范围到5000,倒不是说会超时,但是会超内存,在书上看了一个很好的方法就是滚动数组,感觉挺新鲜的,也挺厉害的,但是滚动数组只节省空间,不省时间 #include<iostream> #include<string&g…
poj1159--Palindrome(dp:最长公共子序列变形 + 滚动数组)
Palindrome Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 53414 Accepted: 18449 Description A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a…