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】
Palindrome
Number
Question:Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.Somehints:Couldnegativeintegersbe
palindrome
s
lcj_cjfykx
·
2014-12-11 02:00
poj 3280 Cheapest
Palindrome
(区间dp)
题意:给出很一个含有m个字符的字符串,然给出字符串中出现的字符对应删除和添加的价值,问怎么操作使这个字符串成为回文,并且价值最小。题解:状态:dp[i][j]表示i到j的最小价值,这样思考:三种情况:1、如果dp[i+1][j]已经是回文了,那么就考虑是将i这个位的字符删除还是在j后面加上a[i] 2、如果dp[i][j-1]是回文串了,其他的同上。3、dp[i+1][j-1]是回文串了。那么很显
My_ACM_Dream
·
2014-12-10 11:00
dp
poj
hdu1513——
Palindrome
Palindrome
TimeLimit:4000/2000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(
Guard_Mine
·
2014-12-09 18:00
dp
Palindrome
s //简单字符串
#include #include intmain() { inti,mid,len; charstdc[50]={'A',0,0,0,'3',0,0,'H','I','L',0,'J','M',0,'O',0,0,0,'2','T','U','V','W','X','Y','5','1','S','E',0,'Z',0,0,'8',0}; charch[30]; boolisr,ism; w
Ash_Zheng
·
2014-12-05 17:00
刘汝佳
UVAOJ401-
Palindrome
s
/*
Palindrome
s Aregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,
kalilili
·
2014-12-04 11:00
[LeetCode]Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
u014691362
·
2014-12-03 21:00
java
LeetCode
[LeetCode]
Palindrome
Partitioning 回文分割
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
jiyanfeng1
·
2014-12-03 09:00
判断字符串是不是回文,使用C++、Python两种语言
coreboolis_
palindrome
(char*s){intend=strlen(s)-1;intpre=0;while(pre
fjiweofjsdkl
·
2014-12-02 20:20
C++
答疑解惑与典型题解
Valid
Palindrome
code:classSolution: #@params,astring #@returnaboolean defis
Palindrome
(self,s): zheng='' fan='' foriins
hongkangwl
·
2014-12-01 21:00
LeetCode
python
UVA - 401-
Palindrome
s
题目链接:
Palindrome
sUVA-401
Palindrome
sTimeLimit:3000MS MemoryLimit:Unknown 64bitIOFormat:%lld&%lluSubmitStatusDescriptionAregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexam
u014355480
·
2014-12-01 17:00
Algorithm
C++
character
uva
CString
Palindrome
s _easy version
Palindrome
s_easyversionTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
zchlww
·
2014-11-28 00:00
printf
数据
测试
回文数
[LeetCode]
Palindrome
Number 验证回文数字
Determine whether an integer is a
palindrome
. Do this without extra space.
·
2014-11-27 02:00
LeetCode
USACO 1.2 Dual
Palindrome
s (回文,进制转换)
废话不哆嗦,贴代码:/* ID:twd30651 PROG:dualpal LANG:C++ */ #include #include #include #include usingnamespacestd; chars[100]; intN,S; voidgs(intnum,intBASE) { intindex=0; while(num/BASE) { s[index++]="01234567
wdkirchhoff
·
2014-11-25 20:00
Lettcode_125_Valid
Palindrome
——判断字符串是否为回文串
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41488377Valid
Palindrome
Givenastring
pistolove
·
2014-11-25 20:00
java
LeetCode
算法
String
character
P4
Thelargest
palindrome
madefromtheproductoftwo2-digitnumbers is9009=91×99.
fred1653
·
2014-11-22 21:00
USACO 1.2 Dual
Palindrome
s
依旧是暴力判断,没啥好说的#include #include #include #include usingnamespacestd; intn,s; intt(0),p; inta[100]; boolcheck(intn,intk) { intt=0; while(n) { a[t++]=n%k; n/=k; } for(inti=0;i!=t/2;++i) if(a[i]!=a[t-i-
baidu_23081367
·
2014-11-22 02:00
CodeForces 486C
Palindrome
Transformation
题意:n(10^5)个字符 光标停在第pos个字符上 光标可以左右任意移动 而且可以从最左移到最右也可以从最右移到最左 在光标处的字符可以按字母顺序或倒序更改 更改也可以a->z或者z->a 光标移动和字符更改都需要1s 问最短几s能把串变成回文的思路:最后的状态是一定的 因此更改的次数和策略无关 扫一遍就可以知道更改最少需要几s光标移动需要一定的策略 容易想到最优的方法一定是在字符串的一半移动
u013351160
·
2014-11-21 21:00
codeforces
贪心
nyoj Splits the string 749
Splitsthestring时间限制:1000 ms | 内存限制:65535 KB难度:3描述Hrdvisinterestedinastring,especiallythe
palindrome
string.Sohewantssome
palindrome
string.Asequenceofcharactersisa
palindrome
ifitisthesamewrittenforwardsand
u012349696
·
2014-11-21 20:00
nyoj
动态规划DP
[C++]LeetCode: 25 Valid
Palindrome
题目:Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
cinderella_niu
·
2014-11-20 13:00
String
Two
Pointes
【LeetCode】
Palindrome
Partitioning 解题报告
【题目】Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningof
ljiabin
·
2014-11-16 16:00
Algorithm
LeetCode
String
回文
回溯
【LeetCode】
Palindrome
Partitioning II 解题报告
【题目】Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningof
ljiabin
·
2014-11-16 16:00
LeetCode
Algorithm
动态规划
回文
最小割
UVA - 11151 Longest
Palindrome
题目大意:给出一个字符串,计算这个字符串的最长回文子串,不同的是,它的子串可以不连续解题思路:就是求当前这个字符串和其逆序的最长公共子序列#include #include #include usingnamespacestd; intmain(){ intT; scanf("%d%*c",&T); charA[1005]; while(T--){ gets(A); intDP[1005][1
kl28978113
·
2014-11-15 11:00
【索引】Codeforces Round #277(Div. 2)
ProblemA:CalculatingFunction(486A)ProblemB:ORinMatrix(486B)ProblemC:
Palindrome
Transformation(486C)ProblemD
u011328934
·
2014-11-13 13:00
Codeforces 486C
Palindrome
Transformation(贪心)
题目链接:Codeforces486C
Palindrome
Transformation题目大意:给定一个字符串,长度N,指针位置P,问说最少花多少步将字符串变成回文串。
u011328934
·
2014-11-13 00:00
Codeforces Round #277 (Div. 2)C——
Palindrome
Transformation
C.
Palindrome
Transformationtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputNamisplayingwithastringonhiscomputer.ThestringconsistsofnlowercaseEnglishletters.It
Guard_Mine
·
2014-11-12 18:00
codeforces
贪心
第十一周项目六:1000内的回文数且素数
#include usingnamespacestd; boolis
Palindrome
(intn); boolisPrimer(intn); intmain() { intn; for
liyingjie01
·
2014-11-11 18:00
第十一周项目六:1000内的回文数
#include usingnamespacestd; boolis
Palindrome
(intn); intmain() { intn; for(n=0;n0) { r=x%10;
liyingjie01
·
2014-11-11 18:00
算法导论-第15章-动态规划-15-2 最长回文子序列(LPS)
问题描述回文序列(Palindromicsequence,
Palindrome
)是指正向遍历和反向遍历完全相同的序列,例如字符串“AAAAA”显然是一个回文序列,又如字符串“ABC@CBA”也是一个回文序列
u012243115
·
2014-11-11 14:00
算法导论
第十一周项目六:回文数
#include usingnamespacestd; boolis
Palindrome
(intn); intmain() { intm; cin>>m; if(is
Palindrome
liyingjie01
·
2014-11-10 11:00
1-11-6 - (2)定义is
palindrome
函数(判断输入数据是否回文)
问题及代码:/* *Copyright(c)2014,烟台大学计算机与控制工程学院 *Allrightsreserved. *文件名称:main.cpp *作者:何小乐 *完成日期:2014年11月10日 *版本号:v1.0 * *问题描述:定义一个函数,判断输入的数据是否是回文数 *输入描述:输入数据 *程序输出:判断这个数据是否是回文数 */ #include u
hexiaole1994
·
2014-11-10 11:00
C++
程序设计基础
第十一周 项目6-2 判断是否为回文数
#include usingnamespacestd; intis
palindrome
(intn); intmain() { intm; cin>>m; if(m==is
palindrome
huangyong000
·
2014-11-10 11:00
[C++]LeetCode: 12
Palindrome
Number
题目:Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.clicktoshowspoilers.Somehints:Couldnegativeintegersbe
palindrome
s
cinderella_niu
·
2014-11-09 10:00
Math
leetcode:
Palindrome
Partitioning
问题描述Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningof
frank-liu
·
2014-11-08 18:00
partition
UVA 11584 Partitioning by
Palindrome
s
ProblemH:Partitioningby
Palindrome
sWesayasequenceofcharactersisa
palindrome
ifitisthesamewrittenforwardsandbackwards.Forexample
DoJintian
·
2014-11-08 15:00
ACM
uva
第11周项目六 回文~素数(2)
问题描述: 编制is
Palindrome
(),用于判断参数是否是回文数——回文数,即从前往后读和从后往前读都一样的数,如1122和121都是回文数,而1231、123都不是回文数。
zp___waj
·
2014-11-07 17:00
编程
C++
namespace
计算机
Valid
Palindrome
好久没写代码了.................代码:classSolution { public: boolis
Palindrome
(strings) { stringstr(1,'/'); for(
u014674776
·
2014-11-07 16:00
LeetCode
C++
第11周项目6-回文、素数 回文数
* 文件名称:test.cpp * 作 者:刘畅 * 完成日期:2014年 11 月 6日 * 版 本 号:v1.0 * * 问题描述:编译is
Palindrome
()
Liuchang54
·
2014-11-06 20:00
C++
namespace
源代码
iostream
[Leetcode]
Palindrome
Partitioning
Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningof
leo524891010
·
2014-11-05 16:00
POJ 1159
Palindrome
(字符串变回文:LCS)
POJ1159
Palindrome
(字符串变回文:LCS)http://poj.org/problem?
u013480600
·
2014-11-04 12:00
Algorithm
算法
dp
ACM
POJ 3280 Cheapest
Palindrome
Cheapest
Palindrome
TimeLimit: 2000MSMemoryLimit: 65536KTotalSubmissions: 4809Accepted: 2338DescriptionKeepingtrackofallthecowscanbeatrickytasksoFarmerJohnhasinstalledasystemtoautomateit.Hehasinstalledo
u012797220
·
2014-11-04 11:00
HDOJ 4731 Minimum
palindrome
Minimum
palindrome
TimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission
u012797220
·
2014-11-04 11:00
2013 ACM/ICPC Asia Regional Chengdu Online 1004 Minimum
palindrome
Minimum
palindrome
TimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission
u012797220
·
2014-11-04 11:00
LeetCode Valid
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
wuli2496
·
2014-11-03 21:00
POJ1159——
Palindrome
Palindrome
TimeLimit:3000MS MemoryLimit:65536KTotalSubmissions:53647 Accepted:18522DescriptionA
palindrome
isasymmetricalstring
Guard_Mine
·
2014-11-01 16:00
dp
LeetCode 143
Palindrome
Number
Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.clicktoshowspoilers.Somehints:Couldnegativeintegersbe
palindrome
s
ustc_summer
·
2014-11-01 16:00
LeetCode
number
palindrome
UVA-401
Palindrome
s
题意:一个字符串可以有两种属性,一个是否回文,一个是否镜像回文。根据两种结果的组合有四种答案,对应四种输出。而镜像回文在题中有给出条件。只要根据得出就可以了。#include #include #include #include #include usingnamespacestd; mapm; charstr[1001]; intf1,f2; voidinit() { m['E']='3';m[
KJBU2
·
2014-10-31 13:00
判断回文
1、从两头往中间bool is
palindrome
(const char *s, int n) { char *front, *back; /* 非法输入 */ if (s ==
enull
·
2014-10-27 15:00
No to
Palindrome
s! 构造不含回文子串的串
http://codeforces.com/contest/465/problem/C给定n和m,以及一个字符串s,s不存在长度大于2的回文子串,现在要求输出一个字典比s大的字符串,且串中字母在一定范围内,并且说同样不存在长度大于2的回文子串。直接去递归构造即可,从最后一位开始,每次只要判断是否子串中含有回文串,其实仔细想想只要考虑是否存在一个字符和前两个字符中的一个相同即可。不卡时限,裸的判断都
u012774187
·
2014-10-25 09:00
hdu 1318
Palindrome
s
pid=1318题目描述:
Palindrome
sTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
hackerwin7
·
2014-10-24 17:00
palindrome
Mirrored
Ural 1635 Mnemonics and
Palindrome
s(DP)
题目地址:Ural1635又是输出路径的DP。。。连着做了好多个了。。状态转移还是挺简单的。要先预处理出来所有的回文串,tag[i][j]为1表示字符串i--j是一个回文串,否则不是回文串。预处理时要用n^2的方法,即枚举回文串中间,可以分奇数和偶数两种分别求一次。然后dp转移方程为,若tag[j][i]==1,dp[i]=min(dp[i],dp[j-1]+1);对于最令人讨厌的路径输出,可以用
u013013910
·
2014-10-23 21:00
编程
算法
dp
C语言
ACM
上一页
83
84
85
86
87
88
89
90
下一页
按字母分类:
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
其他