码迷,mamicode.com
首页 >  
搜索关键字:palindromic    ( 595个结果
LeetCode第[5]题(Java):Longest Palindromic Substring 标签:String、动态规划
题目中文:求最长回文子串 题目难度:Medium 题目内容: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 翻译: ...
分类:编程语言   时间:2018-03-19 19:09:23    阅读次数:224
1019. General Palindromic Number (20)
A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number ...
分类:其他好文   时间:2018-03-10 17:48:20    阅读次数:199
Leetcode 516. Longest Palindromic Subsequence
问题链接 "Leetcode 516" 题目解析 求最长回文子序列。 解题思路 子序列和子串有区别的,子序列不需要连续,相对位置递增即可。 动态规划。对于任意字符串,如果头尾字符相同,那么字符串的最长回文子序列等于去掉首尾的字符串的最长回文子序列加上首尾;如果首尾字符不同,则最长子序列等于去掉头的字 ...
分类:其他好文   时间:2018-03-08 17:27:40    阅读次数:122
Leetcode 647. Palindromic Substrings
问题链接 "Leetcode 647" 题目解析 计算字符串的回文子串数。 解题思路 一个小问题,子串(Substring)、子数组(Subarray)和子序列(Subsequence)的区别:子串和子数组是等同的,特点是 连续的 ,比如[1,2,3]的子串有(1), (2), (3), (1,2) ...
分类:其他好文   时间:2018-03-08 14:09:37    阅读次数:184
【XSY2534】【CF835D】Palindromic characteristics 回文自动机
题目大意 ? 一个字符串$s$是$1$?回文串当且仅当这个串是回文串。 ? 一个串$s$是$k$?回文串$(k 1)$当且仅当$s$的前一半与后一半相同且$s$的前一半是非空$(k?1)$?回文串。 ? 一个串$s$的前一半是这个串的长度为$\lfloor\frac{|s|}{2}\rfloor$的 ...
分类:其他好文   时间:2018-03-05 18:10:26    阅读次数:196
5_Longest Palindromic Substring(Manacher) --LeetCode
参考:https://www.felix021.com/blog/read.php?2040,https://segmentfault.com/a/1190000002991199 做了修改。 首先用一个非常巧妙的方式,将所有可能的奇数/偶数长度的回文子串都转换成了奇数长度:在每个字符的两边都插入一 ...
分类:其他好文   时间:2018-03-02 22:07:31    阅读次数:151
[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 ...
分类:其他好文   时间:2018-03-01 17:06:59    阅读次数:169
Codeforces Round #463
A - Palindromic Supersequence B - Recursive Queries C - Permutation Cycle D - Tree E - Team Work F - Escape Through Leaf G - Palindrome Partition ...
分类:其他好文   时间:2018-02-24 14:57:45    阅读次数:202
Manacher’s Algorithm
最长的回文字符串第二部分 原文为英文页面,地址:https://articles.leetcode.com/longest-palindromic-substring-part-ii/ 给定一个字符串S,找到S中最长的回文子字符串。 注意:这是文章的第二部分:最长回文子串。在这里,我们描述了一个算法 ...
分类:其他好文   时间:2018-02-23 20:43:57    阅读次数:217
【ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) A】 Palindromic Supersequence
【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 字符串倒着加到原串右边就好 【代码】 cpp include using namespace std; int main(){ ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", std ...
分类:其他好文   时间:2018-02-18 20:41:19    阅读次数:188
595条   上一页 1 ... 14 15 16 17 18 ... 60 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!