11151专题

UVA - 11151 Longest Palindrome

题意:以为是求最长回文串,结果用Manacher 一直错,原来题目是求最长回文子串,汗!!那么就很好处理了,跟之前的一样,当str[l]==str[r]的时候,+1,否则在dp(l+1,r),dp(l,r-1)找最大的 #include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using na

uva 11151 Longest Palindrome

原题: A palindrome is a string that reads the same from the left as it does from the right. For example, I, GAG and MADAM are palindromes,but ADAM is not. Here, we consider also the empty string as a p