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
Valid
Palindrome
II(验证回文字符串 II)
题目level:easyGivenanon-emptystrings,youmaydeleteatmostonecharacter.Judgewhetheryoucanmakeita
palindrome
.Example1
wang碗碗
·
2020-08-26 11:18
leetcode刷题笔记
Leetcode - 动态规划1
示例2:输入:"cbbd"输出:"bb"思路1中心扩展,即依次以每个字符作为回文串的中心字符,先两侧扩展.这里需要注意的是,需要分别考虑回文串为奇数和偶数的情况.deflongest
Palindrome
mhxin
·
2020-08-25 16:13
leetcode
python
longest
Palindrome
substring
classSolution{public:stringlongest
Palindrome
(strings){//StarttypingyourC/C++solutionbelow//DONOTwriteintmain
benbenab
·
2020-08-25 16:13
String
用 PHP 来刷leetCode 之 最长回文子串
示例2:输入:"cbbd"输出:"bb"方法一:暴力法应该是第一眼就想出来的方法了逻辑也符合一般思想(最简单--)functionis
Palindrome
($str){if($str===strrev(
陶太郎
·
2020-08-25 15:39
PHP
算法
LeetCode热门100之最长回文子串
代码:classSolution{public:stringlongest
Palindrome
(strings){intmaxl=0;intleft=0,right=0;s.insert(0,"$");
Channel_R
·
2020-08-25 15:33
LeetCode
Codeforces 914E
Palindrome
s in a Tree 点分治
题意一颗树,每个节点有一个字母,对于每一个结点,输出经过他的路径的个数,要求路径上经过的字母可以组成回文串题解做这个题之前,只知道边分治牛逼,有种边分治无敌的错觉…紧接着做这个题就被啪啪打脸边分治根本做不了,只好点分治了枚举一个结点,找出所有经过他的符合要求的路径,但是,难的地方在于,所有的路径上的点都要统计进去答案为解决这个问题,可以采用只在路径末端打标记,然后从叶子到根向上传递累加答案的方式怎
Spy97
·
2020-08-25 14:55
Codeforces
分治
LeetCode题库_简单题
回文数leetcode题目链接算法:反转一半:-负数不可能是回文-个位数一定是回文-0是回文问题:-如何反转一半的数字算法实例:boolis
Palindrome
(intx){if(xReverNum){
十一Eleven
·
2020-08-25 12:11
LeetCode
LeetCode刷题总结101~150
LeetCode刷题总结101~150101.SymmetricTree121.BestTimetoBuyandSellStock122.BestTimetoBuyandSellStockII125.Valid
Palindrome
136
carpediemZJ
·
2020-08-25 11:01
leetcode
面试题01.04-回文排列
classSolution{public:boolcanPermute
Palindrome
(strings){vectorarr(128,0);for(inti=0;i0){returnfalse;}elseif
liudongshizhang
·
2020-08-25 11:01
leetcode
POJ 3974-
Palindrome
(Manacher算法)
题目地址:POJ3974题意:求最长的回文串。思路:同样是用Mancher算法在O(n)的时间内解决(我其实是来练练板子的#include#include#include#include#include#include#include#include#include#include#include#pragmacomment(linker,"/STACK:102400000,102400000")
Rocky0429
·
2020-08-25 09:56
Poj
Manacher算法
算法
algorithm
Manacher
LeetCode 336. 回文对
题目链接:https://leetcode-cn.com/problems/
palindrome
-pairs/如果直接每两个字符串合并,然后去判断是不是回文串的话,会超时。其实可以转化为匹配问题。
untilyouydc
·
2020-08-25 09:31
LeetCode
Leetcode - 动态规划1
示例2:输入:"cbbd"输出:"bb"思路1中心扩展,即依次以每个字符作为回文串的中心字符,先两侧扩展.这里需要注意的是,需要分别考虑回文串为奇数和偶数的情况.deflongest
Palindrome
mhxin
·
2020-08-25 09:38
leetcode
python
ABC 175 F - Making
Palindrome
有nnn个串,每个串sis_isi每次的使用费用为cic_ici,求最小的形成回文串的费用.n≤50,∣si∣≤20n\le50,|s_i|\le20n≤50,∣si∣≤20.比赛的时候没做出来,真是降智…定义f[i][j][k]f[i][j][k]f[i][j][k]表示(i,j,k)(i,j,k)(i,j,k)这个状态到回文串还需要多少费用,其中iii表示串的种类,jjj表示下标,kkk表示方
zsyzlzy
·
2020-08-25 04:03
搜索
leetcode 55: Valid
Palindrome
Valid
Palindrome
Jan13Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
xudli
·
2020-08-25 00:29
leetcode
Palindrome
s and Super Abilities URAL - 1960 (回文自动机)
AftersolvingsevenproblemsonTimusOnlineJudgewithaword“
palindrome
”intheproblemname,Mishahasgotanunusualability.Now
Top_Spirit
·
2020-08-24 23:12
回文自动机
ACM题解系列之一:刘汝佳:《算法竞赛入门经典》(第2版)
章例题POJ1488UVA272UVALive5381TEXQuote【输入输出】POJ2538ZOJ1884UVA10082WERTYU【输入输出】HDU1318POJ1590UVA401ZOJ1325
Palindrome
s
weixin_34375233
·
2020-08-24 23:30
Palindrome
s and Super Abilities 2 回文自动机
2040.
Palindrome
sandSuperAbilities2题目连接:http://acm.timus.ru/problem.aspx?
weixin_33716941
·
2020-08-24 23:57
Hdu5785-Interesting(回文串处理)
ProblemDescriptionAlicegetastringS.Shethinks
palindrome
stringisinteresting.Nowshewannaknowhowmanythreetuple
weixin_30764771
·
2020-08-24 23:43
HDU 5658 CA Loves Palindromic(回文树)
Others)TotalSubmission(s):301AcceptedSubmission(s):131ProblemDescriptionCAlovesstrings,especiallylovesthe
palindrome
s
weixin_30284355
·
2020-08-24 23:20
CodeForces 17E Palisection(回文树)
E.Palisectiontimelimitpertest2secondsmemorylimitpertest128megabytesinputstandardinputoutputstandardoutputInanEnglishclassNickhadnothingtodoatall,andrememberedaboutwonderfulstringscalled
palindrome
s.Wes
weixin_30216561
·
2020-08-24 23:18
leetcode 回文数
classSolution{public:boolis
Palindrome
(intx){if(x<0){returnfalse;}inttemp=x;inttemp2=0;while(temp){
LeeBooL
·
2020-08-24 23:46
leetcode
Codeforces Beta Round #17 E. Palisection(回文树)
E.Palisectiontimelimitpertest2secondsmemorylimitpertest128megabytesinputstandardinputoutputstandardoutputInanEnglishclassNickhadnothingtodoatall,andrememberedaboutwonderfulstringscalled
palindrome
s.Wes
akxxsb
·
2020-08-24 23:39
数据结构
LeetCode ::
Palindrome
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.题目也是很简短,唯一值得注意的是,负数全部不是回文数字,一开始我没考虑到负数
Eleven_Adam
·
2020-08-24 23:39
HDU 5658 CA Loves Palindromic (回文树。)
ProblemDescriptionCAlovesstrings,especiallylovesthe
palindrome
strings.Onedayhegetsastring,hewantstoknowhowmanypalindromicsubstringsinthesubstringS
sky_miange
·
2020-08-24 23:18
回文树
G - CA Loves Palindromic HDU - 5658
CAlovesstrings,especiallylovesthe
palindrome
strings.Onedayhegetsastring,hewantstoknowhowmanypalindromicsubstringsinthesubstringS
AKone123456
·
2020-08-24 23:38
回文自动机
字符串哈希(应用)
【求取最长回文串】:POJ3974
Palindrome
正逆都哈希一遍,枚举对称轴,分别对奇数长度和偶数长度做二分,如果区间的正逆哈希值相同证明其为回文串。【求取连续重复串】:Cod
Zery_
·
2020-08-24 23:07
ACM——字符串
CA Loves Palindromic (回文树-区间本质不同的回文串的种数)
https://cn.vjudge.net/contest/314885#problem/CCAlovesstrings,especiallylovesthe
palindrome
strings.Onedayhegetsastring
永夜莫明
·
2020-08-24 22:27
回文树/回文自动机
Palindrome
s and Super Abilities (回文树-本质不同的回文串的种数)
https://cn.vjudge.net/contest/314885#problem/BAftersolvingsevenproblemsonTimusOnlineJudgewithaword“
palindrome
永夜莫明
·
2020-08-24 22:27
回文树/回文自动机
2019 Multi-University Training Contest 2:I Love
Palindrome
String(回文树(模板) + 字符串hash(模板)或manacher)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6599题目大意:给你一个串让你求s[l,r]s[l,r]s[l,r]是回文串且s[l,l+r2]s[l,\frac{l+r}{2}]s[l,2l+r]也是回文串的子串数目。输出答案时要按长度划分答案,也就是按r-l+1划分答案然后依次输出所有长度的满足条件的子串数目。题解:裸板题,用回文树求出所有不同质
猝死在学ACM的路上
·
2020-08-24 22:21
回文树
字符串
Manacher
字符串哈希
紫书《算法竞赛入门经典》
紫书《算法竞赛入门经典》题目一览第3章数组和字符串(例题)UVA272TEXQuotesUVA10082WERTYUUVA401
Palindrome
sUVA340Master-MindHintsUVA1583DigitGeneratorUVA1584CircularSequence
Andres_Lionel
·
2020-08-24 22:15
贪心
POJ-3974
Palindrome
Manacher模板题#include#include#includeusingnamespacestd;constintN=1e6+5;constintNN=2e6+5;chars[N],ss[NN];intp[NN],len,ans;voidManacher(){intl=0;ss[l++]='$';ss[l++]='#';for(inti=0;ii?min(p[2*c-i],MaxR-i):
qq_25243147
·
2020-08-24 22:09
Manacher
Palindrome
pairs( manacher+dp )
题目链接:codeforces159D题目大意:给出一个字符出,求取这个字符串中互相不覆盖的两个回文子串的对数。题目分析:首先能够用manacher模板,因为这个算法处理的字符串的长度式奇数,所以我们首先将原字符串拓展,也就是用一个没有出现过的子串填充到每两个字符之间,首位也要添加,这样处理后得到的字符串一定是奇数长度,对于这个字符串,偶数位上的字符对应原字符串中i/2-1位置上的字符。然后就是利
黎辰
·
2020-08-24 22:38
codeforces的dp专题
HDU 5658 CA Loves Palindromic (回文树)
Others)TotalSubmission(s):374AcceptedSubmission(s):161ProblemDescriptionCAlovesstrings,especiallylovesthe
palindrome
s
MrBlankIsAwesome
·
2020-08-24 22:13
回文树
HDU 5785 Interesting (manacher+区间处理)
Java/Others)TotalSubmission(s):595AcceptedSubmission(s):227ProblemDescriptionAlicegetastringS.Shethinks
palindrome
stringisinteres
LzyRapX
·
2020-08-24 22:43
HDUOJ
ACM_Manacher
HDU
5785
Interesting
manacher
区间处理
DP:
Palindrome
Palindrome
TimeLimit:3000MSMemoryLimit:65536KTotalSubmissions:42770Accepted:14582DescriptionA
palindrome
isasymmetricalstring
lethic
·
2020-08-24 22:09
ACM_动态规划
HDU 5658 CA Loves Palindromic
ProblemDescriptionCAlovesstrings,especiallylovesthe
palindrome
strings.Onedayhegetsastring,hewantstoknowhowmanypalindromicsubstringsinthesubstringS
_Occult_
·
2020-08-24 22:46
HDU
----回文树
URAL 1960-
Palindrome
s and Super Abilities (回文树)
题意:按照题目给的字符串的顺序,每次添加一个字符,问你当前本质不同的回文串有多少个?题解:回文数模板题,学了一发大佬的模板:http://blog.csdn.net/u013368721/article/details/42100363#include#include#include#include#includeusingnamespacestd;constintmaxn=100005;cons
信仰..
·
2020-08-24 22:52
回文树
Leetcode 131:
Palindrome
Partitioning
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
zhihua_bupt
·
2020-08-24 22:10
C++
LeetCode
LeetCode算法分析
Leetocde:
Palindrome
Partitioning II
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningofs.Forexample
ZkvIA
·
2020-08-24 21:44
Leetcode
算法与数据结构
程序员笔试面试
URAL 2040
Palindrome
s and Super Abilities 2 (回文自动机)
Palindrome
sandSuperAbilities2题目链接:http://acm.hust.edu.cn/vjudge/contest/126823#problem/EDescriptionDimaaddsletterss1
dituonian8372
·
2020-08-24 21:13
Leetcode:
Palindrome
Permutation
QuestionGivenastring,determineifapermutationofthestringcouldforma
palindrome
.Forexample,“code”->False,
ayst123
·
2020-08-24 21:17
leetcode
URAL1960-
Palindrome
s and Super Abilities
Palindrome
sandSuperAbilitiesTimelimit:1.0secondMemorylimit:64MBAftersolvingsevenproblemsonTimusOnlineJudgewithaword
Wang_128
·
2020-08-24 21:51
----回文树
URAL
Leetcode:
Palindrome
Number
题目:Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.思路分析:回文判断,题目提示不能使用直接转字符串,不能翻转数字。
卡尔曼和玻尔兹曼谁曼
·
2020-08-24 21:27
Leetcode习题解析
leetcode
回文
poj 3280 (DP)
Cheapest
Palindrome
TimeLimit:2000MSMemoryLimit:65536KTotalSubmissions:9402Accepted:4539DescriptionKeepingtrackofallthecowscanbeatrickytasksoFarmerJohnhasinstalledasystemtoautomateit.Hehasinstalledoneac
Kerwun
·
2020-08-24 21:52
记忆化搜索
Prefix-Suffix
Palindrome
(字符串hash) /详解
D1.Prefix-Suffix
Palindrome
(Easyversion)D2.Prefix-Suffix
Palindrome
(Hardversion)题意:对于给出的字符串,可截取其前缀和后缀,求能组成的最长回文串
我不会DP
·
2020-08-24 21:49
URAL - 1960
Palindrome
s and Super Abilities
题意:给出一个串,问对于串的每个前缀各包含多少种回文串思路:按http://blog.csdn.net/u013368721/article/details/42100363所讲回文树的思路所写。代码:#includeusingnamespacestd;constintMAXN=100005;constintN=26;structPalindromic_Tree{intnext[MAXN][N];
azure1cloud
·
2020-08-24 21:59
—————数据结构—————
>字符串<
Palindromic
Tree
POJ-3974 , HDU-3294, Hdu-3613(manacher)
题目链接:
Palindrome
思路简单的manacher模板,不多说.
‘’云腾致雨‘’
·
2020-08-24 21:53
manacher
CA Loves Palindromic (回文自动机)
CAlovesstrings,especiallylovesthe
palindrome
strings.Onedayhegetsastring,hewantstoknowhowmanypalindromicsubstringsinthesubstringS
Top_Spirit
·
2020-08-24 21:20
回文自动机
A - Palisection (Manacher)
InanEnglishclassNickhadnothingtodoatall,andrememberedaboutwonderfulstringscalled
palindrome
s.Weshouldremindyouthatastringiscalleda
palindrome
ifitcanbereadthesamewaybothfromlefttorightandfromrighttoleft
Top_Spirit
·
2020-08-24 21:20
回文串
Manacher
strings
Palindrome
s and Super Abilities (回文自动机)
AftersolvingsevenproblemsonTimusOnlineJudgewithaword“
palindrome
”intheproblemname,Mishahasgotanunusualability.Now
Top_Spirit
·
2020-08-24 21:20
回文自动机
上一页
17
18
19
20
21
22
23
24
下一页
按字母分类:
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
其他