E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
palindrome
算法学习(九)回文的判断
回文:英文
palindrome
,指一个顺着读和反过来读都一样的字符串,不如madam、mnnm。回文判断判断一个字符串是否是回文。
shitangdejiaozi
·
2016-05-03 17:00
算法
回文
URAL 1297
Palindrome
(后缀数组)
Description给出一个字符串,求最长回文子串长度Input一个长度不超过1000的字符串Output输出这个串的最长回文子串,如果有多种满足条件的解则输出首字符靠前的SampleInputThesampletextthatcouldbereadedthesameinbothordersArozaupalanalapuazorASampleOutputArozaupalanalapuazor
V5ZSQ
·
2016-05-03 14:00
Palindrome
Linked List [easy] (Python)
题目链接https://leetcode.com/problems/
palindrome
-linked-list/题目原文Givenasinglylinkedlist,determineifitisa
palindrome
.Followup
coder_orz
·
2016-05-03 14:00
LeetCode
python
单链表
Valid
Palindrome
[easy] (Python)
题目链接https://leetcode.com/problems/valid-
palindrome
/题目原文Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
coder_orz
·
2016-05-03 14:00
LeetCode
python
Leetcode -
Palindrome
Linked List
QuestionGivenasinglylinkedlist,determineifitisa
palindrome
.FollowupCouldyoudoitinO(n)timeandO(1)space?
roamer_nuptgczx
·
2016-05-03 13:00
LeetCode
list
palindrome
Palindrome
Partitioning
Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningof
u010005161
·
2016-05-03 11:00
LeetCode
C++
backtracking
HDU 5677 ztr loves substring
ProblemDescriptionztrlovereserachsubstring.Today,hehasnstring.Nowztrwanttokonw,canhetakeoutexactlyk
palindrome
fromallsubstringofthesenstring
jtjy568805874
·
2016-05-02 19:00
HDU
HDU-ACM2029
Palindrome
s_easyversionTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
x121850182
·
2016-05-02 10:00
java
算法
编程语言
ACM
杭电
[置顶] 计算复杂性学习1-单带图灵机模拟
PAL(
Palindrome
)定义如下:对于任意的x∈{0,1}∗,如果x是回文,则PAL等于1,否则等于0。就是说,PAL(x)=1当且仅当x从左到右读和从右向左读是一样的。
u010392759
·
2016-05-02 00:00
算法
X
图灵机
计算复杂性
回文串的组合 DP
D.
Palindrome
pairstimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanon-emptystring
zcj5027
·
2016-05-01 22:00
java判断字符串是否回文
java判断字符串是否回文 /** *java判断字符串是否回文 *基本思想是利用字符串首尾对应位置相比较 * *@authorInJavaWeTrust * */ publicclass
Palindrome
InJavaWeTrust
·
2016-05-01 22:00
java
Algorithm
UVa 401
Palindrome
s
本题展现了JAVA字符处理的强大能力importjava.util.Scanner; publicclassMain{ publicstaticvoidmain(String[]args){ Scannercin=newScanner(System.in); while(cin.hasNextLine()){ Strings=cin.nextLine(); Stringss=newString(
YYecust
·
2016-05-01 21:00
leetcode——132——
Palindrome
Partitioning II
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningofs.Forexample
happyxuma1991
·
2016-05-01 21:00
leetcode——131——
Palindrome
Partitioning
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
happyxuma1991
·
2016-05-01 19:00
UVA 11475 Extend to
Palindrome
(kmp || manacher || 后缀数组)
题目链接:点击打开链接题意:给你一个串,让你在串后面添加尽可能少的字符使得这个串变成回文串。思路:这题可以kmp,manacher,后缀数组三种方法都可以做,kmp和manacher效率较高,时间复杂度是O(n),后缀数组时间复杂度是O(nlogn).思路是求出元串的后缀和反串的前缀匹配的最大长度。用后缀数组的时候求出l=lcp(i,len+1),判断l+i是不是等于len,如果等于那么就是结果。
Kirito_Acmer
·
2016-05-01 15:00
KMP
后缀数组
Manacher
HDU 5677 ztr loves substring (dp)
ProblemDescriptionztrlovereserachsubstring.Today,hehasnstring.Nowztrwanttokonw,canhetakeoutexactlyk
palindrome
fromallsubstringofthesenstring
dml_96
·
2016-05-01 12:00
Leetcode - Valid
Palindrome
QuestionGivenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
roamer_nuptgczx
·
2016-04-30 15:00
LeetCode
String
palindrome
leetcode--Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
a1b2c3d4123456
·
2016-04-28 19:00
String
leetcode---
Palindrome
Linked List
Givenasinglylinkedlist,determineifitisa
palindrome
.Followup:CouldyoudoitinO(n)timeandO(1)space?
a1b2c3d4123456
·
2016-04-28 19:00
链表
leetcode---
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.思路是:先把int–>string–>char[]publicclassSolution
a1b2c3d4123456
·
2016-04-28 19:00
String
26-
Palindrome
Number
回文数的判定,不使用额外的空间Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.思路:将一个整数逆转,判定和原来的数相不相等注意负数一定不是回文数
justdoithai
·
2016-04-28 12:00
回文数
LeetCode125—Valid
Palindrome
LeetCode125—Valid
Palindrome
原题Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersand
zhangxiao93
·
2016-04-28 10:00
LeetCode
String
Palindrome
Number
Solution1//Determinewhetheranintegerisa
palindrome
. //Dothiswithoutextraspace.
u011438605
·
2016-04-28 10:00
LeetCode
hdu1513
Palindrome
(动态规划之最长公共子序列变形+滚动数组)
回文问题描述回文是对称的串,也就是一个字串相同读取从左到右以及从右到左。你是写一个程序,给定的字符串,确定要被插入以获得回文字符串的字符的最小数目。作为一个例子,通过将2个字符,字符串“Ab3bd”可转化为一个回文(“dAb3bAd”或“Adb3bdA”)。然而,插入少于2个字符不产生回文。 输入你的程序是从标准输入读取。第一行包含一个整数:输入字符串n的长度,3 #include #includ
zs520ct
·
2016-04-28 09:00
动态规划
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.clicktoshowspoilers.Somehints:Couldnegativeintegersbe
palindrome
s
u012848330
·
2016-04-27 17:00
Palindrome
Linked List
第一种方法,将链表中的值放到数组里,然后判断是否为回文(或者放一半进堆栈,然后判断是否为回文),然而时间复杂度为O(N),空间复杂度为O(N),没有达到O(N)/O(1)的要求。/***Definitionforsingly-linkedlist.*publicclassListNode{*intval;*ListNodenext;*ListNode(intx){val=x;}*}*/ publi
qq_20581563
·
2016-04-27 16:00
LeetCode
链表
APIO2014 UOJ 103-105
【APIO2014】
Palindrome
s回文树裸题利用lazy思想延迟标记,最后所有标记倒序更新即可#include #include #include usingnamespacestd; #definerep
nlj1999
·
2016-04-27 10:00
Palindrome
Number(回文整数)
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace. 解析:把该整数倒转过来,如果和原来的数字相等,则说明是回文整数。
yang20141109
·
2016-04-26 17:00
[bzoj 3676][uoj #103]【APIO2014】
Palindrome
s回文串 后缀数组+manachar
给你一个由小写拉丁字母组成的字符串ss。我们定义ss的一个子串的存在值为这个子串在ss中出现的次数乘以这个子串的长度。对于给你的这个字符串ss,求所有回文子串中的最大存在值。输入格式一行,一个由小写拉丁字母(a~z)组成的非空字符串ss。输出格式输出一个整数,表示所有回文子串中的最大存在值。样例一inputabacabaoutput7explanation用∣s∣∣s∣表示字符串ss的长度。一个字
ALPS233
·
2016-04-26 11:00
[bzoj 3676][uoj #103]【APIO2014】
Palindrome
s回文串 后缀数组+manachar
给你一个由小写拉丁字母组成的字符串ss。我们定义ss的一个子串的存在值为这个子串在ss中出现的次数乘以这个子串的长度。对于给你的这个字符串ss,求所有回文子串中的最大存在值。输入格式一行,一个由小写拉丁字母(a~z)组成的非空字符串ss。输出格式输出一个整数,表示所有回文子串中的最大存在值。样例一inputabacabaoutput7explanation用∣s∣∣s∣表示字符串ss的长度。一个字
ALPS233
·
2016-04-26 11:00
Palindrome
Partitioning
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
github_34333284
·
2016-04-26 00:00
LeetCode
Palindrome
Partitioning II
LeetCode解题之
Palindrome
PartitioningII原题将一个字符串分割成若干个子字符串,使得子字符串都是回文字符串,要求最少需要几次分割能够满足需求。
u013291394
·
2016-04-25 21:00
LeetCode
算法
python
动态规划
回文
【APIO2014】【UOJ103】【BZOJ3676】
Palindrome
s 题意&代码(C++)
题目链接:http://uoj.ac/problem/103题解:一道题让我新了解到了两个算法:处理回文子串问题的manacher算法与快速求RMQ的ST算法,至于后缀数组之前学习过不过还是抄模板了,附学习资料:manacher:http://www.open-open.com/lib/view/open1419150233417.htmlST算法:http://blog.csdn.net/ins
deritt
·
2016-04-25 15:41
oi之路
DERIT的博客专栏
【APIO2014】【UOJ103】【BZOJ3676】
Palindrome
s 题意&代码(C++)
题目链接:http://uoj.ac/problem/103题解:一道题让我新了解到了两个算法:处理回文子串问题的manacher算法与快速求RMQ的ST算法,至于后缀数组之前学习过不过还是抄模板了,附学习资料:manacher:http://www.open-open.com/lib/view/open1419150233417.htmlST算法:http://blog.csdn.net/ins
DERITt
·
2016-04-25 15:00
算法
字符串
后缀数组
st
Manacher
【APIO2014】【UOJ103】【BZOJ3676】
Palindrome
s 题意&代码(C++)
题目链接:http://uoj.ac/problem/103题解:一道题让我新了解到了两个算法:处理回文子串问题的manacher算法与快速求RMQ的ST算法,至于后缀数组之前学习过不过还是抄模板了,附学习资料:manacher:http://www.open-open.com/lib/view/open1419150233417.htmlST算法:http://blog.csdn.net/ins
DERITt
·
2016-04-25 15:00
算法
字符串
后缀数组
st
Manacher
LintCode:回文链表
__(self,x): #self.val=x #self.next=None classSolution: #@paramhead,aListNode #@returnaboolean defis
Palindrome
u012225151
·
2016-04-24 22:00
链表
CodeForces245H - Queries for Number of
Palindrome
s(区间dp)
dp(i)(j)表示在区间(i,j)里有多少个回文串,dp(i)(j)=dp(i+1)(j)+dp(i)(j-1)-dp(i+1)(j-1)+flag(i,j).若str(i)到str(j)是回文串,则flag(i,j)为1#include #definemaxn5005 #defineINF1e9 usingnamespacestd; typedeflonglongll; charstr[ma
qq_26122039
·
2016-04-23 14:00
UVA - 11584 Partitioning by
Palindrome
s
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=34398题意:给你一个长度为n(n#include#include#include#include#include#includeusingnamespacestd;#definell longlongintconstll mod=1000000007;constin
longshanxiaoxuesheng
·
2016-04-23 10:00
dp
uva
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.clicktoshowspoilers.Somehints:Couldnegativeintegersbe
palindrome
s
a2415180498
·
2016-04-23 10:00
LeetCode
C++
number
palindrome
LeetCode
Palindrome
Partitioning
LeetCode解题之
Palindrome
Partitioning原题将一个字符串分割成若干个子字符串,使得子字符串都是回文字符串,要求列出所有的分割方案。
u013291394
·
2016-04-21 21:00
LeetCode
算法
python
递归
poj1159——
Palindrome
(组成回文串的最少字符数,dp)
DescriptionA
palindrome
isasymmetricalstring,thatis,astringreadidenticallyfromlefttorightaswellasfromrighttoleft.Youaretowriteaprogramwhich
BYSora
·
2016-04-21 20:22
动态规划
poj1159——
Palindrome
(组成回文串的最少字符数,dp)
DescriptionA
palindrome
isasymmetricalstring,thatis,astringreadidenticallyfromlefttorightaswellasfromrighttoleft.Youaretowriteaprogramwhich
blue_skyrim
·
2016-04-21 20:00
String
dp
poj
AS
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.Easytomakemistakes.....Therearemorethantwowaystohandleit
github_34333284
·
2016-04-20 23:00
Palindrome
Pairs
distinct indices (i,j) inthegivenlist,sothattheconcatenationofthetwowords,i.e. words[i]+words[j] isa
palindrome
.Example1
u014568921
·
2016-04-20 10:00
LeetCode
Palindrome
Partitioning
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
github_34333284
·
2016-04-20 06:00
LeetCode 第 125 题 (Valid
Palindrome
)
LeetCode第125题(Valid
Palindrome
)Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
liyuanbhu
·
2016-04-19 12:00
LeetCode
【LeetCode】LeetCode——第9题:
Palindrome
Number
9.
Palindrome
Number MySubmissionsQuestionEditorialSolutionTotalAccepted: 118962 TotalSubmissions: 377213
hujingshuang
·
2016-04-19 10:00
LeetCode
number
palindrome
URAL 2060 Sub
palindrome
Pairs Manacher
给一个长度为n的字符串,找三元组(i,j,k)的个数满足s[i..j]是一个回文串,s[j+1..k]是一个回文串。(i≤j #include #include usingnamespacestd; constintN=610000; chars[N];intp[N],a[N],c[N],d[N]; multisetS; intmain(){ inti,n,m,mx=0,id; longlonga
huanghongxun
·
2016-04-19 08:00
字符串
OI
Manacher
回文串
Timus
CodeChef PALPROB
Palindrome
ness
Palindrome
ness Problemcode: PALPROBTweetALLSUBMISSIONSAllsubmissionsforthisproblemareavailable.Readproblemsstatementsin
jtjy568805874
·
2016-04-18 20:00
URAL 2040
Palindrome
s and Super Abilities 2
DescriptionDimaaddsletters s1,…, sn onebyonetotheendofaword.Aftereachletter,heasksMishatotellhimhowmanynew
palindrome
substringsappearedwhenheaddedthatletter.Twosubstringsareconsidereddistinctiftheyared
jtjy568805874
·
2016-04-18 14:00
上一页
57
58
59
60
61
62
63
64
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他