码迷,mamicode.com
首页 >  
搜索关键字:palindromic    ( 595个结果
Leetcode 5 Longest Palindromic Substring
求最长回文子串的裸题,搞竞赛的时候遇到过各种花样的变式。 n方的朴素算法已经烂大街了,推荐使用O(n)的算法,只可惜很久没用过manacher算法,不会写了,所以花了一段时间温故知新。 manacher算法原理不了解的道友可以看这篇文章:...
分类:其他好文   时间:2016-08-24 15:54:14    阅读次数:167
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-08-24 06:35:43    阅读次数:197
ACM: Gym 101047B Renzo and the palindromic decoration - 手速题
Gym 101047B Renzo and the palindromic decoration Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Practice Gym 101047B Renzo and t ...
分类:其他好文   时间:2016-08-22 21:35:01    阅读次数:123
Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest ...
分类:其他好文   时间:2016-08-22 18:16:49    阅读次数:165
POJ1221(整数划分)
UNIMODAL PALINDROMIC DECOMPOSITIONS Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5430 Accepted: 2641 Description A sequence of positive ...
分类:其他好文   时间:2016-08-22 12:39:17    阅读次数:302
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 ...
分类:其他好文   时间:2016-08-15 18:59:55    阅读次数:146
leetcode 5. Longest Palindromic Substring
https://leetcode.com/problems/longest-palindromic-substring/ 题目:求字符串最长回文串。 第一种思路:以每一个字符为回文串中间的字符时,最长的回文串。考虑回文串字符个数为奇数,偶数的2种情况。 x--,j++ 的向两边扩展,判断最长的回文串 ...
分类:其他好文   时间:2016-08-13 21:08:35    阅读次数:113
5. Longest Palindromic Substring
这道题的关键点在于,对于字符串的赋值操作要谨慎,尽量采用记录下标的方式,而不是整个字符串的赋值,这样可以节省时间。 ...
分类:其他好文   时间:2016-08-09 18:51:00    阅读次数:149
[LeetCode] 5. Longest Palindromic Substring
...
分类:其他好文   时间:2016-08-05 11:45:53    阅读次数:140
LeetCode-Longest Palindromic Substring
这道题是比较常考的题目,求回文子串,一般有两种方法。 第一种方法比较直接,实现起来比较容易理解。基本思路是对于每个子串的中心(可以是一个字符,或者是两个字符的间隙,比如串abc,中心可以是a,b,c,或者是ab的间隙,bc的间隙)往两边同时进行扫描,直到不是回文串为止。假设字符串的长度为n,那么中心 ...
分类:其他好文   时间:2016-07-21 00:35:38    阅读次数:152
595条   上一页 1 ... 28 29 30 31 32 ... 60 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!