码迷,mamicode.com
首页 >  
搜索关键字:palindromic    ( 595个结果
Longest Palindromic Substring - 一题多解
题意是寻找一个字符串的最大回文字串,最简单的是n3方的算法,由于字符串最大长度为1000,所以这个方法很危险而且不科学。紧接着想到的是一个n方的算法:回文子串是从中间向两边产生的,那么对于每个字符考察这个字符往外的所有可能不就可以找到以这个字符为中心的最长回文子串了吗?当然要考虑偶数的情况,即那个中...
分类:其他好文   时间:2015-07-06 15:51:01    阅读次数:106
[LeetCode][Java]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 longest palindromic substring. 题意: 给定字符串S...
分类:编程语言   时间:2015-07-06 12:30:14    阅读次数:115
[leedcode 5]Longest Palindromic Substring
public class Solution { public String longestPalindrome(String s) { //本题是动态规划思想,构造一个数组pal[i][j],表示从i到j是否为一个回文, //pal[i][j]=true;if i=...
分类:其他好文   时间:2015-07-04 22:14:37    阅读次数:236
leetcode解题—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 lo...
分类:其他好文   时间:2015-07-04 18:11:21    阅读次数:119
Leetcode:Longest Palindromic Substring之详细分析
原题链接:https://leetcode.com/problems/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 exis...
分类:其他好文   时间:2015-07-03 10:45:37    阅读次数:146
【LeetCode】005 Longest Palindromic Substring
题目:LeetCode 005 Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of ...
分类:其他好文   时间:2015-06-30 14:49:25    阅读次数:108
BZOJ3103 : Palindromic Equivalence
用Manacher可以推出O(n)对相等和不等关系。将相等的用并查集维护,不等的连边。然后从1到n,如果该等价类还没被考虑过,则ans*=26-与它不等的考虑过的等价类个数。#include#include#define N 1000010int n,m,i,r,p,f[N>=1)==F(y>>=1...
分类:其他好文   时间:2015-06-22 19:17:55    阅读次数:104
[Swust OJ 797]--Palindromic Squares(回文数水题)
题目链接:http://acm.swust.edu.cn/problem/797/Time limit(ms): 1000 Memory limit(kb): 10000DescriptionPalindromes are numbers that read the same forwar...
分类:其他好文   时间:2015-06-22 14:47:51    阅读次数:155
#5 Longest Palindromic Substring
原题链接:https://leetcode.com/problems/longest-palindromic-substring/ Given a string S, find the longest palindromic substring inS. You may assume that the maximum length of S is 1000, and ther...
分类:其他好文   时间:2015-06-21 14:33:22    阅读次数:119
Longest Palindromic Substring2015年6月20日
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...
分类:其他好文   时间:2015-06-20 22:00:33    阅读次数:219
595条   上一页 1 ... 39 40 41 42 43 ... 60 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!