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 longes ...
分类:
其他好文 时间:
2016-10-01 12:30:06
阅读次数:
100
题目来自 https://leetcode.com/problems/longest-palindromic-substring/ 题目:Given a string S, find the longest palindromic substring in S. You may assume tha ...
分类:
其他好文 时间:
2016-09-25 17:26:09
阅读次数:
149
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 longes ...
分类:
其他好文 时间:
2016-09-20 06:49:11
阅读次数:
141
P1206 [USACO1.2]回文平方数 Palindromic Squares 271通过 501提交 题目提供者该用户不存在 标签USACO 难度普及- 提交 讨论 题解 最新讨论 暂时没有讨论 题目描述 回文数是指从左向右念和从右向左念都一样的数。如12321就是一个典型的回文数。 给定一个 ...
分类:
其他好文 时间:
2016-09-19 22:19:32
阅读次数:
193
问题描述: 给定一个字符串S,找出它的最大的回文子串,你可以假设字符串的最大长度是1000,而且存在唯一的最长回文子串 。 思路分析: 动态规划的思路:dp[i][j] 表示的是 从i 到 j 的字串,是否是回文串。 则根据回文的规则我们可以知道: 如果s[i] == s[j] 那么是否是回文决定于 ...
分类:
其他好文 时间:
2016-09-14 20:41:45
阅读次数:
131
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of Sis 1000, and there exists one unique longest ...
分类:
其他好文 时间:
2016-09-07 22:55:39
阅读次数:
165
求最长回文子串: 回文串是指正着读和反过来读都一样的字符串。 方法: 1. 为了统一解题方法,避免字符串长度奇偶对解题方法的影响,加入了填充字符。若原来的字符串长度为n,则新的字符串长度为2n+1。 2. pos+p[pos] 表示的是目前所有回文子串中,向右达到的最远位置。 3. 先利用对称性,找 ...
分类:
其他好文 时间:
2016-08-31 00:45:22
阅读次数:
156
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 longes ...
分类:
其他好文 时间:
2016-08-29 09:05:52
阅读次数:
165