class Solution { public: string longestPalindrome(string s) { int len=s.size(); int left,right; int begin=0,maxlen=0; if(len=0&&rightmaxlen) { ... ...
分类:
其他好文 时间:
2017-11-25 20:01:42
阅读次数:
113
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "b ...
分类:
其他好文 时间:
2017-11-04 14:54:23
阅读次数:
147
题目大意: ? 给定vi,wi,每次可以在wi中选择一个子段[l,r]满足:? |wi-wi+1|=1 (l<=i<r)? 2wi-wi-1-wi+1>=0 (l<i<r)? 选择后获得vr-l+1的收益并把这个子段删除,可以不删完,求最大收益。? n<=400 Examples input 30 ...
分类:
其他好文 时间:
2017-10-27 11:45:24
阅读次数:
166
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: ...
分类:
其他好文 时间:
2017-10-27 01:37:34
阅读次数:
137
1019. General Palindromic Number (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue 时间限制 400 ms 时间限制 400 ms 内存限制 65536 kB 内存限制 6 ...
分类:
其他好文 时间:
2017-10-25 00:36:35
阅读次数:
166
题目链接:http://codeforces.com/problemset/problem/883/H Time limit: 3000 ms Memory limit: 262144 kB Kolya has a string s of length n consisting of lowerca ...
分类:
其他好文 时间:
2017-10-23 18:14:21
阅读次数:
185
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form ...
分类:
其他好文 时间:
2017-10-22 10:54:56
阅读次数:
166
Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c ...
分类:
其他好文 时间:
2017-10-20 14:37:09
阅读次数:
143
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: ...
分类:
其他好文 时间:
2017-10-20 12:02:22
阅读次数:
139
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: ...
分类:
其他好文 时间:
2017-10-17 17:29:48
阅读次数:
185