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
Palindromes
【回文子串的个数】HDU1544
Palindromes
【字符缩距/奇偶判断】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1544ProblemDescriptionAregularpalindromeisastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring"ABCDEDCBA"isapalindromebecauseitis
wlxsq
·
2016-05-09 10:00
SPOJ Number of
Palindromes
(回文树)
NumberofPalindromesTimeLimit: 100MS MemoryLimit: 1572864KB 64bitIOFormat: %lld&%lluSubmit StatusDescriptionEachpalindromecanbealwayscreatedfromtheotherpalindromes,ifasinglecharacterisalsoapalindrome.F
Dacc123
·
2016-05-07 19:00
number
of
spoj
palindrome
回文树
HDU 2163
Palindromes
链接: http://acm.hdu.edu.cn/showproblem.php?pid=2163还是判断回文,栈,输入“STOP”时停止#include #include #include #include usingnamespacestd; intmain() { intk=1; charstr[53]; while(cin>>str,strcmp(str,"STOP")) { boolf
azhuge233
·
2016-05-06 21:00
字符串
栈
水题
HDU2163
HDU 2029
Palindromes
_easy version
链接: http://acm.hdu.edu.cn/showproblem.php?pid=2029栈的运用//不用栈也可以当时把奇数和偶数分开写了,有点啰嗦,其实非常简单#include #include #include usingnamespacestd; intmain() { intT; cin>>T; while(T--) { charstr[1000]; stacks; while(
azhuge233
·
2016-05-06 21:00
字符串
栈
水题
HDU2029
[USACO1.5]回文质数 Prime
Palindromes
题目描述因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以151是回文质数。写一个程序来找出范围[a,b](5 #include boolc[10000000]; intmain(){ intk,j,a,b,i; scanf("%d%d",&a,&b); if(b>9999999)b=9999999; for(i=2;i<=int(sqrt(b));i++) if(!c[i
qq_34215568
·
2016-05-06 21:00
C语言
HDU 1544
Palindromes
(求回文字符串)
PalindromesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):1526 AcceptedSubmission(s):722ProblemDescriptionAregularpalindromeisastringofnumbersorletter
huatian5
·
2016-05-04 22:00
HDU
回文
UVA 11584 Partitioning by
Palindromes
区间dp
点击打开题目链接一个由小写字母组成的字符串,划分成尽量少的回文串。感觉和最长上升子序列差不多,区间dp,方法不对,导致TLE了好久。dp[R]=min(dp[R],dp[L-1]+1)(L #include #include #include usingnamespacestd; constintMAXN=1000+10; intdp[MAXN]; charch[MAXN]; boolisPa
Houheshuai
·
2016-05-03 19:00
dp
ACM
HDU-ACM2029
Palindromes
_easyversionTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
x121850182
·
2016-05-02 10:00
java
算法
编程语言
ACM
杭电
UVa 401
Palindromes
本题展现了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
APIO2014 UOJ 103-105
【APIO2014】
Palindromes
回文树裸题利用lazy思想延迟标记,最后所有标记倒序更新即可#include #include #include usingnamespacestd; #definerep
nlj1999
·
2016-04-27 10:00
[bzoj 3676][uoj #103]【APIO2014】
Palindromes
回文串 后缀数组+manachar
给你一个由小写拉丁字母组成的字符串ss。我们定义ss的一个子串的存在值为这个子串在ss中出现的次数乘以这个子串的长度。对于给你的这个字符串ss,求所有回文子串中的最大存在值。输入格式一行,一个由小写拉丁字母(a~z)组成的非空字符串ss。输出格式输出一个整数,表示所有回文子串中的最大存在值。样例一inputabacabaoutput7explanation用∣s∣∣s∣表示字符串ss的长度。一个字
ALPS233
·
2016-04-26 11:00
[bzoj 3676][uoj #103]【APIO2014】
Palindromes
回文串 后缀数组+manachar
给你一个由小写拉丁字母组成的字符串ss。我们定义ss的一个子串的存在值为这个子串在ss中出现的次数乘以这个子串的长度。对于给你的这个字符串ss,求所有回文子串中的最大存在值。输入格式一行,一个由小写拉丁字母(a~z)组成的非空字符串ss。输出格式输出一个整数,表示所有回文子串中的最大存在值。样例一inputabacabaoutput7explanation用∣s∣∣s∣表示字符串ss的长度。一个字
ALPS233
·
2016-04-26 11:00
【APIO2014】【UOJ103】【BZOJ3676】
Palindromes
题意&代码(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】
Palindromes
题意&代码(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】
Palindromes
题意&代码(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
CodeForces245H - Queries for Number of
Palindromes
(区间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
Palindromes
题目链接: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
URAL 2040
Palindromes
and Super Abilities 2
DescriptionDimaaddsletters s1,…, sn onebyonetotheendofaword.Aftereachletter,heasksMishatotellhimhowmanynewpalindromesubstringsappearedwhenheaddedthatletter.Twosubstringsareconsidereddistinctiftheyared
jtjy568805874
·
2016-04-18 14:00
URAL 1960
Palindromes
and Super Abilities
DescriptionAftersolvingsevenproblemsonTimusOnlineJudgewithaword“palindrome”intheproblemname,Mishahasgotanunusualability.Now,whenhereadsaword,hecanmentallycountthenumberofuniquenonemptysubstringsofthis
jtjy568805874
·
2016-04-13 13:00
ural
[数据结构-hash]CF 7D Palindrome Degree
Stringsoflengthniscalledk-palindrome,ifitisapalindrome(回文)itself,anditsprefixandsuffixoflengthare(k - 1)-
palindromes
.Bydefinition
reborn_ZhMZ
·
2016-04-12 12:00
lightoj 1033 - Generating
Palindromes
(区间dp)
1033-GeneratingPalindromes PDF(English)StatisticsForumTimeLimit: 2second(s)MemoryLimit: 32MBBydefinitionpalindromeisastringwhichisnotchangedwhenreversed. "MADAM" isaniceexampleofpalindrome.Itisaneas
dml_96
·
2016-04-07 22:00
USACO 1.5-Prime
Palindromes
/* ID:m1590291 TASK:pprime LANG:C++ */ #include usingnamespacestd; /****************************************************************************************************************** 题意并不难理解,函数简单。然后做了
qq_28300479
·
2016-04-06 23:00
USACO 1.2-Dual
Palindromes
/* ID:m1590291 TASK:dualpal LANG:C++ */ #include #include usingnamespacestd; ifstreamfin("dualpal.in"); ofstreamfout("dualpal.out"); constchara[]={'0','1','2','3','4','5','6','7','8','9'}; intn,m; boo
qq_28300479
·
2016-04-04 22:00
hdoj 2029
Palindromes
_easy version (字符串)
Palindromes
_easyversionTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
bmicnj
·
2016-04-03 14:00
CodeForces 17E Palisection
DescriptionInanEnglishclassNickhadnothingtodoatall,andrememberedaboutwonderfulstringscalled
palindromes
.Weshouldremindyouthatastringiscalledapalindromeifitcanbereadthesamewaybothfromlefttorightandfrom
jtjy568805874
·
2016-04-03 14:00
codeforces
HDOJ 2029
Palindromes
_easy version
ProblemDescription“回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。Input输入包含多个测试实例,输入数据的第一行是一个正整数n,表示测试实例的个数,后面紧跟着是n个字符串。Output如果一个字符串是回文串,则输出”yes”,否则输出”no”.SampleInput4levelabcdeno
xanlv
·
2016-03-23 17:00
20160321 UVa RUJIA 算法竞赛入门经典:镜像回文,生成元,环状序列
401-
Palindromes
#include #include chars[105],s1[105],s2[105],t; charalp[]="A000300HIL0JM0O0002TUVWXY5"
Fantastic_
·
2016-03-22 15:00
算法竞赛入门经典
UVa 401
Palindromes
(回文串与镜像串的综合判断)
PalindromesTimeLimit:3000MSMemoryLimit:Unknown64bitIOFormat:%lld&%lluSubmitStatusDescriptionAregularpalindromeisastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring"ABCDEDCBA"i
hurmishine
·
2016-03-15 16:00
Palindromes
UVa401
Prime
Palindromes
--回文+素数判断
分析:由于数据已经大于10的5次方,我们不能打表,所以,只能先暴力枚举出所有回文数,然后再判断是否为素数Code:#include #include #include #include usingnamespacestd; intpri[10000]; intcnt; boolisPrime(intn){ intsqr=sqrt(n*1.0); for(inti=2;ib)break; if(
hhhhhhj123
·
2016-03-13 11:00
Partitioning by
Palindromes
uva111584
mainalgorithm:tocounthowmanyPalindromesastringincludegiveoutallthewayitcombine,andjudgewhetheritsaPalindromes,ifitis,f[i]=min(f[i].f[j-1]+1)code:#include#include#includeusingnamespacestd;constintN=100
deepquiet
·
2016-03-12 19:42
动态规划
ACM杭电的AC回顾——2029
题目
Palindromes
_easyversionTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
皮禾火
·
2016-03-02 22:33
ACM
Palindromes
(UVA401)
3:
Palindromes
查看提交统计总时间限制: 1000ms 内存限制: 65536kB描述Aregularpalindromeisastringofnumbersorlettersthatisthesameforwardasbackward.Forexample
u011613367
·
2016-03-02 21:00
字符串
ACM
uva
UVa 11584 Partitioning by
Palindromes
dp : 线性结构上dp LIS
UVA-11584PartitioningbyPalindromesTimeLimit: 1000MS MemoryLimit: Unknown 64bitIOFormat: %lld&%lluSubmit StatusThequestionisfrom here.MySolutiond[i]=min{d[j]+1|is[j+1][i]是回文串};d[i]表示0~i内回文串的最小个数;然后对于is
ProLightsfxjh
·
2016-02-26 19:00
dp
ACM
uva
LIS
线性结构上的dp
UVA 401(p48)----
Palindromes
#include usingnamespacestd; constcharrev[]="A3HILJMO2TUVWXY51SEZ8"; conststringans[]={"isnotapalindrome.","isaregularpalindrome.","isamirroredstring.","isamirroredpalindrome."}; charReverse(charst) {
wang2147483647
·
2016-02-25 22:00
【HDOJ】3948 The Number of
Palindromes
后缀数组求不重复回文子串数目。注意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
Palindromes
后缀数组求不重复回文子串数目。注意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
UVa 401 -
Palindromes
注意一个字符时要判断是否是镜像的情况。#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
Palindromes
、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
Ruby的几道题目
编程要求: (1)设计函数,统一命名为
palindromes
.rb (2)输出格式 执行结果根据字符串长度由大到小输出。
hjl240
·
2016-01-23 22:00
Ruby
习题
HDOJ 2029
Palindromes
_easy version
ProblemDescription“回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。Input输入包含多个测试实例,输入数据的第一行是一个正整数n,表示测试实例的个数,后面紧跟着是n个字符串。Output如果一个字符串是回文串,则输出”yes”,否则输出”no”.SampleInput4levelabcdeno
qq_26525215
·
2016-01-22 15:00
英语语言能力挑战游戏: anagrams &
palindromes
基于英语语言的知名游戏(可以归类为智商挑战题):anagramsanagram定义为一个有着相同的字母的不同的词,例:stop的anagram为:tops,opts,pots,andspot类似的还有:stoolandtoolssecureandrescueanagrams就是多个词,具有相同的字母,但是意义完全不同,例:DormitoryandDirtyRoomElvisandLivesThec
MindProbe
·
2016-01-21 17:00
Ural1960
Palindromes
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
USACO--Dual
Palindromes
DualPalindromesMarioCruz(Colombia)&HugoRickeboer(Argentina)Anumberthatreadsthesamefromrighttoleftaswhenreadfromlefttorightiscalledapalindrome.Thenumber12321isapalindrome;thenumber77778isnot.Ofcourse,p
lk951208
·
2015-12-27 13:00
UVA 题目401 -
Palindromes
(回文词)
Aregularpalindromeisastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring "ABCDEDCBA" isapalindromebecauseitisthesamewhenthestringisreadfromlefttorightaswhenthestringisreadfromr
Hoaresky1998
·
2015-11-23 21:00
编程
C++
ACM
SZU:B54 Dual
Palindromes
Judge Info Memory Limit: 32768KB Case Time Limit: 10000MS Time Limit: 10000MS Judger: Number Only Judger Description A number that reads the same from right to left as when read from le
·
2015-11-13 19:00
dual
UVA 11584
Problem H: Partitioning by
Palindromes
We say a sequence of characters is a palindrome if
·
2015-11-13 19:18
uva
uvaoj 401
Palindromes
*******************************题目描述*************************************************** UVA - 401
Palindromes
·
2015-11-13 15:40
ROM
LeetCode 009 Palindrome Number
Some hints: Could negative integers be
palindromes
? (ie, -1) If you are thinking of converting the
·
2015-11-13 13:18
LeetCode
Leetcode | Palindrome Number
Some hints:Could negative integers be
palindromes
?
·
2015-11-13 13:38
LeetCode
UVa-
Palindromes
题目地址:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=6&problem=342&mosmsg=Submission+received+with+ID+12044263 C++代码: #inc
·
2015-11-13 13:54
ROM
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
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
其他