[leetcode]Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring....
分类:
其他好文 时间:
2014-10-02 13:30:42
阅读次数:
217
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
面DP题的考官都是神经病。。(吐...
分类:
其他好文 时间:
2014-10-01 13:15:31
阅读次数:
242
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-09-30 17:19:19
阅读次数:
173
Generalized Palindromic Number
Time Limit: 2 Seconds Memory Limit: 65536 KB
A number that will be the same when it is written forwards or backwards is known as a palindromic number. For e...
分类:
其他好文 时间:
2014-09-28 12:56:12
阅读次数:
242
题目 Given a string s,find the longest palindromic substring in S.You may assume that the maximum length of S is 1000,and there exist one unique longes....
分类:
其他好文 时间:
2014-09-17 21:46:02
阅读次数:
238
实现了两种方法,一种是DP,用循环做的,递归的话更简单。
string longestPalindrome(string s) {
int n = s.size();
bool dp[1001][1001];
int maxl = 1;
int maxs = 0;
for (int i = n - 1; i >= 0...
分类:
其他好文 时间:
2014-09-14 12:53:07
阅读次数:
190
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-09-14 12:49:37
阅读次数:
214
Generalized Palindromic Number
Time Limit: 2 Seconds
Memory Limit: 65536 KB
A number that will be the same when it is written forwards or backwards is known as a palindromic number. For ...
分类:
其他好文 时间:
2014-09-12 11:59:43
阅读次数:
186
Generalized Palindromic Number
Time Limit: 2 Seconds Memory Limit: 65536 KB
A number that will be the same when it is written forwards or backwards is known as a palindromic number. For exa...
分类:
其他好文 时间:
2014-09-11 13:55:32
阅读次数:
215