码迷,mamicode.com
首页 >  
搜索关键字:palindromic substrin    ( 620个结果
Longest Palindromic Substring问题
问题描述: 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 ...
分类:其他好文   时间:2016-10-14 00:31:17    阅读次数:185
string类;math类;datetime类
String类: .Length 字符的长度 .Trim() 去掉开头以及结尾的空格 .TrimStart() 去掉字符串开头的空格 .TrimEnd() 去掉字符串后面的空格 .ToUpper() 全部大写 .ToLower() 全部小写 Substring(起始位置,截取长度) Substrin ...
分类:其他好文   时间:2016-10-12 22:45:44    阅读次数:164
Longest Palindromic Substring
题目如下: 此题用Manacher算法求解,时间复杂度为O(n) Python代码: ...
分类:其他好文   时间:2016-10-07 14:07:23    阅读次数:151
leetcode5。Longest Palindromic Substring
写了一个爆搜,超时了,所以更改了一个方法,使用flag数组记录标志, 动态规划,类似于lcs的解法,数组flag[i][j]记录s从i到j是不是回文 首先初始化,i>=j时,flag[i][j]=true,这是因为s[i][i]是单字符的回文,当i>j时,为true,是因为有可能出现flag[2][ ...
分类:其他好文   时间:2016-10-02 19:36:57    阅读次数:146
[LightOJ1205]Palindromic Numbers(数位dp)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1205 题意:求[l,r]内回文数的数量。 dp(s,l,ok)表示数字以s为开头,长度为l的时是/不是回文数 dp(s,l,ok)可以由dp(s,l-1,ok)更新来,当且仅当接下来插入 ...
分类:其他好文   时间:2016-10-02 17:16:05    阅读次数:131
[LeetCode #5] Longest Palindromic Substring
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
leetcode--5. Longest Palindromic Substring
题目来自 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
Longest Palindrome Substring
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
P1206 [USACO1.2]回文平方数 Palindromic Squares 271通过 501提交 题目提供者该用户不存在 标签USACO 难度普及- 提交 讨论 题解 最新讨论 暂时没有讨论 题目描述 回文数是指从左向右念和从右向左念都一样的数。如12321就是一个典型的回文数。 给定一个 ...
分类:其他好文   时间:2016-09-19 22:19:32    阅读次数:193
最长回文子串(Longest Palindromic Substring)-DP问题
问题描述: 给定一个字符串S,找出它的最大的回文子串,你可以假设字符串的最大长度是1000,而且存在唯一的最长回文子串 。 思路分析: 动态规划的思路:dp[i][j] 表示的是 从i 到 j 的字串,是否是回文串。 则根据回文的规则我们可以知道: 如果s[i] == s[j] 那么是否是回文决定于 ...
分类:其他好文   时间:2016-09-14 20:41:45    阅读次数:131
620条   上一页 1 ... 28 29 30 31 32 ... 62 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!