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
LeetCode 214 Shortest
Palindrome
(KMP)
Refer: https://segmentfault.com/a/1190000003059361 O(n^2)SolutionpublicStringshortest
Palindrome
(Strings
xwang2014
·
2016-02-15 08:00
回文串和镜像串
constchar*rev="A3HILJMO2TUVWXY51SEZ8";//前26项为各个大写字母的镜像,后10个是数字1至9的镜像(不输入数字0) constchar*msg[]={"nota
palindrome
阿飞的小蝴蝶蝶
·
2016-02-14 19:00
回文数与回文字符串的判断
#include using namespace std; int
Palindrome
Number(size_t count) { //1.在自然数范围内
脚印C
·
2016-02-14 18:54
回文数
回文字符串
回文数字
Palindrome
Partitioning II
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningofs.Forexample
KickCode
·
2016-02-14 12:07
动态规划
回文字符串
Palindrome
Partitioning
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
KickCode
·
2016-02-14 12:22
回文字符串
hdu1513
Palindrome
【最长公共子序列&滚动数组】
问加几个字符能变成回文串==赤裸裸的LCS而且都不用记录路径MLE了两发才意识到真的得用滚动数组==/************ hdu1513 2016.2.12 483MS1616K975BG++ ************/ #include #include #include usingnamespacestd; intc[2][5005],n,sum; charx[5005],y[5005]
zhou_yujia
·
2016-02-12 15:00
dp
HDU
Palindrome
Partitioning
题目:Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
codeTZ
·
2016-02-11 20:00
LeetCode
String
回溯
Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
KickCode
·
2016-02-11 01:00
回文字符串
poj_3974
Palindrome
(最长回文子串)
【题目】点击这里【思路】直接运用Manacher算法。【代码】#include #include #definemaxSize1000005 #definemin(x,y)(xi)r[i]=min(r[j]+j-i,r[2*j-i]);elser[i]=1; while(s[i-r[i]]==s[i+r[i]])r[i]++; if(i+r[i]>j+r[j])j=i; } longintans
cleopard66
·
2016-02-10 23:00
算法
字符串
poj
最长回文子串
Manacher
hdoj 5617 Jam's maze(滚动数组dp求回文数)
Jam'smazeProblemDescriptionJamgotintoamaze,hehastofinda
palindrome
pathfrom (1,1) to (N,N) togetout.Howeverheisnotonlythinkingabouthowtogetoutofthemaze
a709743744
·
2016-02-10 02:00
UVA 10617 Again
Palindrome
Apalindormeisasequenceofoneormorecharactersthatreadsthesamefromtheleftasitdoesfromtheright.Forexample,Z,TOTandMADAMare
palindrome
s
·
2016-02-10 01:00
dp
String
uva
LeetCode题解:
Palindrome
Partitioning
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
u012403246
·
2016-02-09 13:00
LeetCode
Java [Leetcode 234]
Palindrome
Linked List
题目描述:Givenasinglylinkedlist,determineifitisa
palindrome
.Followup:CouldyoudoitinO(n)timeandO(1)space?
scottwang
·
2016-02-06 19:00
Palindrome
Number
题目:Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.思考过程:题目很简单,要求是判断一个数是否是回文数,回文数的定义就是数字翻转之后与原先的数一样的话就是回文数
leilba
·
2016-02-05 22:00
LeetCode
C++
【HDOJ】3948 The Number of
Palindrome
s
后缀数组求不重复回文子串数目。注意dp数组。1/*3948*/ 2#include 3#include 4#include 5#include 6#include 7#include 8#include 9#include 10#include 11#include 12#include 13#include 14#include 15#include 16#incl
Bombe
·
2016-02-04 00:00
【HDOJ】3948 The Number of
Palindrome
s
后缀数组求不重复回文子串数目。注意dp数组。1/*3948*/ 2#include 3#include 4#include 5#include 6#include 7#include 8#include 9#include 10#include 11#include 12#include 13#include 14#include 15#include 16#incl
Bombe
·
2016-02-04 00:00
[Leetcode]-
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.题目:推断int数据是否为回文数注意:负数不是回文数,0是最小的回文数思路:
mengfanrong
·
2016-02-03 10:00
[Leetcode]-
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.题目:推断int数据是否为回文数注意:负数不是回文数,0是最小的回文数思路:
mengfanrong
·
2016-02-03 10:00
POJ 1159
Palindrome
题目链接:http://poj.org/problem?id=1159这道题本质上是求一个子序列和其逆子序列的最长公共子序列(证明略),但是输出的是未匹配的字符数。数据比较大,5000*5000的数据,开数组肯定MLE,但是不小心用short睡过去了==!正解应该是用滚动数组,把数据缩小到2*5000.因为当前状态之和前一状态有关,所以进行i%2取余就好了。#include #include #i
rachelsg
·
2016-02-02 17:00
LeetCode 234
Palindrome
Linked List(回文链表)(*)(?)
原文Givenasinglylinkedlist,determineifitisa
palindrome
. Followup: CouldyoudoitinO(n)timeandO(1)space?
NoMasp
·
2016-02-02 12:00
LeetCode
list
linked
palindrome
234
LeetCode 234
Palindrome
Linked List(回文链表)(*)(?)
原文Givenasinglylinkedlist,determineifitisa
palindrome
. Followup: CouldyoudoitinO(n)timeandO(1)space?
NoMasp
·
2016-02-02 12:00
LeetCode
list
linked
palindrome
234
LeetCode 125 Valid
Palindrome
(有效回文)(*)
原文Givenastring,determineifitisa
palindrome
,consider
NoMasp
·
2016-02-02 12:00
LeetCode
valid
palindrome
125
isalnum
Longest Palindromic Substring(最长回文子串)
stringfindLongest
Palindrome
(string&str){ size_tn=str.size(); size_tmax_length=0; size_tlen=0; size_tstart
u013871984
·
2016-02-02 07:00
HDU4632
Palindrome
subsequence(区间DP)
题目点我点我点我题意:找一个字符串里有多少个回文子序列。(注意是子序列,如:abcsdpfocba,abccba就是一种情况,嘛,应该也没人和我一样一开始我就YY错了orz)思路:区间DP,dp[i][j]表示从第i个到第j个有多少个回文子序列,将所有dp[i][i]初始化为1(题目要求,一个字母也为回文),其他为0.状态转移:因为是记录子序列的数目,i-j的子序列就前一个状态推导过来,而i-j的
L954688947
·
2016-02-01 20:00
dp
ACM
HDU
解题报告
区间DP
回文树(
Palindrome
Tree)/回文自动机(
Palindrome
Automaton)学习小记
简介回文树(回文自动机),是解决一类回文串问题的强大数据结构,比Manacher扩展了很多功能。这个数据结构比较新,由来自战斗民族的神犇MikhailRubinchik在2014年的Petrozavodsk夏令营提出。这个数据结构代码量其实超级少。必备技能Manacher最好会至少一种自动机分析回文树严格来讲是由两棵树构成的森林,再加上一堆后缀链(失配链)。其中一棵树代表长度为奇数的回文串,另一棵
a_crazy_czy
·
2016-01-31 17:00
数据结构
字符串
OI
自动机
回文串
UVa 401 -
Palindrome
s
注意一个字符时要判断是否是镜像的情况。#include #defineMAXN22 usingnamespacestd; charconst*ch="AEHIJLMOSTUVWXYZ12358"; charconst*re="A3HILJMO2TUVWXY51SEZ8"; boolbijiao(chara1,charb1){ for(inti=0;i>n){ chara,b; inthw=1,jx
a272846945
·
2016-01-31 11:00
uva
Pig and
Palindrome
s、HDU 5617 Jam's maze(dp)
题意:给定N∗M,N,M≤500的字母迷宫,从(1,1)出发去(n,m),只能向右和向下走问路径形成的字符串是回文串的路径有多少,答案对MOD取模分析:考虑有2个人分别从(1,1)和(n,m)同时出发,在中间相遇考虑状态f[x1][y1][x2][y2]:=第1个人到(x1,y1),第2个人到(x2,y2)符合条件的路径数显然O(n4)会T,考虑一个常见优化,由于2个人走的步数是相同的,只要记录步
lwt36
·
2016-01-31 00:00
dp
Valid
Palindrome
题目链接https://oj.leetcode.com/problems/valid-
palindrome
/心得本身没什么难度,还是在于对原始字符串的处理。
Titan0427
·
2016-01-30 20:00
LeetCode
python
最长回文串算法
暴力法通过遍历整个字符串来说实现对最长回文串的查找首先一个字符串所有子串,个数为n2个,然后逐个判断遍历即可,算法复杂度O(n3)代码如下:defis_
palindrome
(s): str_length
EthanWhite
·
2016-01-29 14:00
算法
遍历
动态规划
扩展
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.第一种想到的是转化为数组,前后对比元素看是否相等。
chenyx90
·
2016-01-27 21:29
leetcode
leetcode-125 Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
scutcoder
·
2016-01-27 20:00
Valid
Palindrome
125.Valid
Palindrome
MySubmissionsQuestionTotalAccepted: 85331 TotalSubmissions: 369741 Difficulty: Easy
EbowTang
·
2016-01-25 21:00
LeetCode
数据结构
面试
字符串
数学
Palindrome
Number 回文数
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.判断一个数是否为回文数。我们需要知道的负数不属于回文数。
KickCode
·
2016-01-25 03:00
java
面试
回文数
84.Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
u010339647
·
2016-01-24 21:00
leetcode刷题,总结,记录,备忘 9
leetcode9,
Palindrome
NumberDeterminewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.clicktoshowspoilers.Subscribe
guicaisa
·
2016-01-24 20:00
USACO--Palindromic Squares
PalindromicSquaresRobKolstad
Palindrome
sarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypical
palindrome
.GivenanumberbaseB
lk951208
·
2016-01-24 11:00
Ruby的几道题目
编程要求: (1)设计函数,统一命名为
palindrome
s.rb (2)输出格式 执行结果根据字符串长度由大到小输出。
hjl240
·
2016-01-23 22:00
Ruby
习题
LinkedList各种操作
publicbooleanis
Palindrome
(ListNodehead){ if(head==null){ returntrue; } ListNodemid=findMiddle(head)
u014470581
·
2016-01-23 18:00
java
数据结构
LinkedList
uva 10739 String to
Palindrome
原题:Inthisproblemyouareaskedtoconvertastringintoa
palindrome
withminimumnumberofoperations.Theoperationsaredescribedbelow
·
2016-01-23 14:00
uva
LeetCode5——Longest Palindromic Substring 最易懂的解法
S.Youmayassumethatthemaximumlengthof S is1000,andthereexistsoneuniquelongestpalindromicsubstring.实现:classSolution{ public: voidget
Palindrome
booirror
·
2016-01-22 23:00
LeetCode
String
面试题
substring
leetcode--
Palindrome
Number
题目要求:Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.Somehints:Couldnegativeintegersbe
palindrome
s
sinat_27683281
·
2016-01-22 17:00
LeetCode
回文数
整数逆序
[leetcode]
Palindrome
Number
题目描述如下:Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.Easy题,判断一个整数是否为回文的。
u012505618
·
2016-01-22 15:00
LeetCode
HDOJ 2029
Palindrome
s _easy version
ProblemDescription“回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。Input输入包含多个测试实例,输入数据的第一行是一个正整数n,表示测试实例的个数,后面紧跟着是n个字符串。Output如果一个字符串是回文串,则输出”yes”,否则输出”no”.SampleInput4levelabcdeno
qq_26525215
·
2016-01-22 15:00
英语语言能力挑战游戏: anagrams &
palindrome
s
基于英语语言的知名游戏(可以归类为智商挑战题):anagramsanagram定义为一个有着相同的字母的不同的词,例:stop的anagram为:tops,opts,pots,andspot类似的还有:stoolandtoolssecureandrescueanagrams就是多个词,具有相同的字母,但是意义完全不同,例:DormitoryandDirtyRoomElvisandLivesThec
MindProbe
·
2016-01-21 17:00
Python算法题----
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.class Solution(object): def numLen
gccmx
·
2016-01-20 14:01
算法
python
回文数字
Python算法题----
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.class Solution(object): def numLen(
gccmx
·
2016-01-20 14:01
算法
python
回文数字
Python
Python算法题----Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
gccmx
·
2016-01-20 13:23
算法
python
Palindrome
Python
Python算法题----Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
gccmx
·
2016-01-20 13:23
算法
python
palindrome
leetcode 9
Palindrome
Number
原题:9.
Palindrome
NumberMySubmissionsQuestionDeterminewhetheranintegerisa
palindrome
.Dothiswithoutextraspace
·
2016-01-18 21:00
LeetCode
Ural1960
Palindrome
s and Super Abilities
嗯,这道题是回文树的裸题。简单讲一下回文树。也可以看看这个回文树笔记(转自quack_quack)structPAM{ inta[MAXN][MAXC],l[MAXN],fa[MAXN],sz,last; /*a就是next数组,一个节点的next[C]节点非空,表示着存在一个回文串在当前节点表示的回文串两边加上各一个字符C。l表示长度len,在初始化的时候我们要建立两个节点,一个的长度为0,一个
geng4512
·
2016-01-18 21:00
上一页
61
62
63
64
65
66
67
68
下一页
按字母分类:
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
其他