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
【算法】算法的艺术(四)
实例解析:文章的内容可以通过键盘输入到一个二维数组中:chars[10][81]; for(i=0;i=65&&s[i][j]=97&&s[i][j] int
palindrome
(char*p)
infohacker
·
2013-04-05 11:28
文章
艺术
区分大小写
计数器
英文字母
HOJ 题目分类 by wywcgs
简单题(包含模拟、数论中最基础的题):1001A+B1002A+B+C1004Prime
Palindrome
s1010TheAngle1011UNIXls1012DecodingTask1014NivenNumbers1015Nearlyprimenumbers1025SkewBinary1039Factorial1043MayaCalendar1057MileageBank1069PrimeLa
niuox
·
2013-04-04 19:40
Algorithm_经典
动态规划——Poj 1159
Palindrome
1)题目
Palindrome
TimeLimit:3000MSMemoryLimit:65536KTotalSubmissions:46005Accepted:15688DescriptionA
palindrome
isasymmetricalstring
庞老板
·
2013-04-04 19:17
动态规划
动态规划——Poj 1159
Palindrome
1) 题目
Palindrome
TimeLimit: 3000MS MemoryLimit: 65536KTotalSubmissions: 46005 Accepted: 15688DescriptionA
palindrome
isasymmetricalstring
code_pang
·
2013-04-04 19:00
动态规划
最长公共子序列
hdu_
Palindrome
s _easy version_解题报告
题目出处简单题思路:回文串题。这里有一篇是用递归解回文串。当然可以用循环解题关键代码:intlen=strlen(str); for(i=0;i<len/2;i++){ if(str[i]!=str[len-1-i]){ //dosomething } }
cbs612537
·
2013-03-31 19:00
ACM
HDU
回文串
回文数 2
package com.gaoyuan; public class
Palindrome
s { public static boolean is
Palindrome
(String s) {
xizhenyin
·
2013-03-31 15:00
回文
leetcode:
Palindrome
Partitioning
Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningof
binary_search
·
2013-03-29 21:00
leetcode:
Palindrome
Partitioning II
可惜第一次就碰到了两个dp的问题
Palindrome
PartitioningII。。。
binary_search
·
2013-03-29 19:00
UVA 11151 Longest
Palindrome
(最大回文串)
这里面读题一定要精准,首先它说的是从一个string里面takeaway一些字符,使得剩下的字符成为一个
palindrome
,这里求的是
palindrome
的最大长度,那么也就是说删除最少的字符使得这个
AClion
·
2013-03-28 08:00
POJ 3974
Palindrome
( Largest
Palindrome
substring )
和之前的类似,以后这样的题目要秒杀!还有wa了一次,问题是i和1我总是打错,以后一定要注意;还有能有printf的就不要用cout了,流还是比较费时的代码如下:#include #include #include #include usingnamespacestd; strings,str; intMaxid,Maxl,id,p[2000020]; voidinit(){ str.clear(
AClion
·
2013-03-28 07:00
USACO Section 1.2 Dual
Palindrome
s
大意略。/* ID:g0feng1 LANG:C++ TASK:dualpal */ #include #include #include #include #include #include #include #include #include #include usingnamespacestd; ofstreamfout("dualpal.out"); ifstreamfin("dual
Wall_F
·
2013-03-27 08:00
leetcode 123:
Palindrome
Partitioning II
Palindrome
PartitioningIIMar1Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningof
xudli
·
2013-03-26 08:00
leetcode 122:
Palindrome
Partitioning
Palindrome
PartitioningFeb28Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningof
xudli
·
2013-03-24 19:00
hdu2029――
Palindrome
s_easy version
原题: ProblemDescription “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。 Input 输入包含多个测试实例,输入数据的第一行是一个正整数n,表示测试实例的个数,后面紧跟着是n个字符串。 Output 如果一个字符串是回文串,则输出"yes",否则输出"no". SampleInput
bingsanchun
·
2013-03-24 00:00
java
开发技术
poj 1159
Palindrome
(最长回文子串)
1、http://poj.org/problem?id=11592、题目大意:给出一个字符串,要求插入最少的字符,使得原字符串为一个回文串看了别人的思路才懂,http://chjzhacm.blog.163.com/blog/static/1749014132011613105450310/转换成最长公共子序列后还超内存,需要用滚动数组,参考百度文库滚动数组http://wenku.baidu.c
sdjzping
·
2013-03-22 19:00
ZOJ 1325
Palindrome
s
#include #include #include #include #include #include #include #include #include #include usingnamespacestd; charss[]="E3JLS2Z5AHIMOTUVWXY18"; intslen; boolishave(charc) { for(inti=0;i
lmyclever
·
2013-03-20 13:00
Palindrome
Partitioning II - leetcode
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningofs.Forexample
从零开始
·
2013-03-18 23:00
Palindrome
Partitioning-leetcode
Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Forexample
从零开始
·
2013-03-18 22:00
ZOJ 2744
Palindrome
s(动态规划)
Palindrome
sTimeLimit:2Seconds MemoryLimit:65536KBAregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample
·
2013-03-18 16:00
动态规划
[leetcode]
Palindrome
Partitioning II
Palindrome
PartitioningIIMar1Givenastring s,partition s suchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningof
tuantuanls
·
2013-03-18 15:00
LeetCode
判断字符串string所有分割和子串是否为回文(
palindrome
)并返回结果(
Palindrome
Partitioning)
在网站http://leetcode.com/onlinejudge上原题1是这样的:(解答见函数partition)
Palindrome
PartitioningGivenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Fo
loveaborn
·
2013-03-17 20:00
Uva - 10739 - String to
Palindrome
题意:给出一个长度不超过1000的由小写字母组成的字符串,使用增、删、改使其变成回文串,问最少操作数。题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=114&problem=1680——>>设d[i][j]为使第i位到第j位变成回文串的最少操作数
SCNU_Jiechao
·
2013-03-16 17:00
POJ 3280 Cheapest
Palindrome
【DP之经典回文问题】
cid=20437#problem/C转载来自:http://blog.sina.com.cn/s/articlelist_1836701754_0_1.htmlCheapest
Palindrome
TimeLimit
Cfreezhan
·
2013-03-15 20:00
【转】POJ 1159
Palindrome
【经典的DP回文问题】
id=1159博文转载链接: http://blog.sina.com.cn/s/blog_6d79d83a01016iqg.html
Palindrome
TimeLimit: 3000MS MemoryLimit
Cfreezhan
·
2013-03-15 19:00
Leetcode :
Palindrome
Number
Palindrome
NumberJan4'12Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.思路:1)这题其实可以参照Leetcode
Errant_Xia
·
2013-03-14 22:00
回文字符串分隔
题目: Given a string s, partition s such that every substring of the partition is a
palindrome
tousin
·
2013-03-14 16:00
算法
回文
ZOJ 2744
Palindrome
s 区间DP
做法:求出i,j直接的字符是否形成回文。b[i][j]=(b[i+1][j-1])&(str[i]==str[j])#include #include constintLMT=5005; booldp[LMT][LMT]; intans; voidinit(void) { memset(dp,0,sizeof(dp)); ans=0; } intmain(void) { charsec[LMT];
cqlf__
·
2013-03-13 23:00
leetcode 117:
Palindrome
Number
Palindrome
NumberJan4'12Determinewhetheranintegerisa
palindrome
.Dothiswithoutextraspace.Somehints:Couldnegativeintegersbe
palindrome
s
xudli
·
2013-03-13 18:00
HDU 1513
Palindrome
dp
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1513 一个字符串,求最少添加多少个字符能使这个字符串成为回文字符串。 dp[i][j]代表从i到j的字串中最少补的字符。1、如果a[i]==a[j],dp[i][j]=dp[i+1][j-1],不用加新字符的情况;2、如果a[i]!=a[j],dp[i][j]=min(dp[i+1][j],dp[i]
ilovexiaohao
·
2013-03-12 21:00
UVA 401 -
Palindrome
s
Aregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring"ABCDEDCBA
hellobinfeng
·
2013-03-11 22:00
UVA 401 -
Palindrome
s
A regular
palindrome
is a string of numbers or letters that is the same forward as backward.
hellobin
·
2013-03-11 22:00
ROM
判断一个整数是否是回文数
数字转换为字符串可以通过itoa函数实现,判断字符串是否为回文字符串代码如下:boolis
Palindrome
(string&str) { intbegin=0,end=str.lengt
liubo2011
·
2013-03-05 08:00
刘汝佳uva 字符串专题
第一题
palindrome
点击打开链接uva401题目意思:给定一个字符串判断是什么类型分析:1根据输出我们知道这个字符串总共有4种类型2首先应该是否是“
palindrome
”,判断的理由很简单直接对这个字符串进行判断
cgl1079743846
·
2013-03-03 12:00
刘汝佳uva 字符串专题
第一题
palindrome
点击打开链接uva 401 题目意思:给定一个字符串判断是什么类型 分析: 1 根据输出我们知道这个字符串总共有4种类型 2 首先应该是否是“
palindrome
从此醉
·
2013-03-03 12:00
字符串
Split string to
palindrome
Question:Giveastring,useminimumnumberofsplitstodividethestringintomultiplepartsinwhicheachparta
palindrome
.Forexample
beiyeqingteng
·
2013-02-24 12:00
Valid a
Palindrome
Givenastring,determineifitisa
palindrome
,consideringonlyalphanumericcharactersandignoringcases.Forexample
violet_program
·
2013-02-21 11:00
寒假后续刷题——回文与镜像文
Palindrome
s Aregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring
hcbbt
·
2013-02-09 12:00
C++
C++
ACM
ACM
刷题
寒假刷题系列
HDT_2029
Palindrome
s _easy version
这题是求"回文串",所谓"回文"就是一个字符串正反读来都是一样的,例如:level,noon.在一个for循环里面定义了两个变量:i,j,以前没有用过这种方法,也不知道可不可以用,但事实证明还是可以用的,呵呵以下是代码:#include #include #include #include usingnamespacestd; intmain() { intn,x,i,j,flag; char
hellokatewj
·
2013-02-07 10:00
求5 ~ 1000000000内的回文素数
Question:Thenumber151isaprime
palindrome
becauseitisbothaprimenumberanda
palindrome
(itisthesamenumberwhenreadforwardasbackward
第九神迹
·
2013-02-02 17:59
Algorithm
&
Data
Structure
求5 ~ 1000000000内的回文素数
Question:Thenumber151isaprime
palindrome
becauseitisbothaprimenumberanda
palindrome
(itisthesamenumberwhenreadforwardasbackward
ArvonZhang
·
2013-02-02 17:00
Algorithm
Algorithm
Mathematics
java判断是否是回文字符
public class
Palindrome
Test { public static void main(String[] args) { isPalidrome(
白浪滔天
·
2013-01-30 22:00
hdu 1513
Palindrome
回文 LCS 滚动数组
求最少补多少个字符使所给字符串变成回文,直接dp,dp[i][j]代表从i到j的字串中最少补的字符。1、如果a[i]==a[j],dp[i][j]=dp[i+1][j-1],不用加新字符的情况;2、如果a[i]!=a[j],dp[i][j]=min(dp[i+1][j],dp[i][j-1])+1,在中间字符串的基础上再补一个字符;n的范围是5000二维会超内存,这里注意每次dp[i][j]的更
yan_____
·
2013-01-28 12:00
USACO:Prime
Palindrome
s
枚举枚举枚举/* ID:JangLawrence PROG:pprime LANG:C++ */ #include #include #include #include #include usingnamespacestd; intl,r; intp[10001]; boolis[10001]; vectorans; chara[11]; intn; intturn() { intres=0; f
Lawrence_Jang
·
2013-01-26 14:00
poj-1159-
Palindrome
-学习滚动数组
题意:给你一串字符串,让你求最少加入几个字符,才能使得这个字符串是个回文串。做法:设a[i]是这个字符串,b[i]是这个字符串的逆序串。那么a[i],b[i]的最长公共子序列就是所求的字符串里拥有的最大的回文串。然后用总串长减去最大的回文串长度即为所求。求最长公共子序列的公式为:dp[i][j]=max(dp[i-1][j],dp[i][j-1])if(a[i]==b[i])dp[i][j]=ma
rowanhaoa
·
2013-01-26 09:00
Prime
Palindrome
s
Prime
Palindrome
sThenumber151isaprime
palindrome
becauseitisbothaprimenumberanda
palindrome
(itisthesamenumberwhenreadforwardasbackward
pucca6
·
2013-01-25 20:00
Hoj 1004 Prime
Palindrome
s
本题练习穷举。题目链接:http://acm.hit.edu.cn/hoj/problem/view?id=1004本题以前做过,之所以记录本题,是因为看到一种生成回文数的有效方法,套用此模板可以快速生成1-10^9范围内的回文数表。虽然看似繁杂,但是却非常有效。本题是求一定范围内的所有回文素数。#include #include #include #include #include usingn
niuox
·
2013-01-22 16:00
找出一个字符串中的最长
palindrome
子串
很容易想到的就是应用brute-force方法,即对每一个给定字符串的子串都做一次判断_is_
palindrome
:bool_is_
palindrome
(strings){ intn=s.length(
zzran
·
2013-01-18 17:00
UVA 11151 Longest
Palindrome
大意不再赘述。思路:由于是求长度,所以我们可用状态方程:d[i][j]表示在区间i~j内的最大回文子串,边界条件为d[i][i]=1;d[i][j]=d[i+1][j-1]+2;str[i]==str[j]d[i][j]=max(d[i+1][j],d[i][j-1]);str[i]!=str[j]题目说空串也是回文子串,长度为0。#include #include #include #inclu
Wall_F
·
2013-01-18 14:00
USACO:Dual
Palindrome
s
大水题 /* ID:JangLawrence PROG:dualpal LANG:C++ */ #include #include #include #include usingnamespacestd; chara[]={"0123456789ABCDEFGHIJKLMN"}; voiddfs(intx,intn) { if(x>=n)dfs(x/n,n); putchar(a[x%n]); }
Lawrence_Jang
·
2013-01-18 13:00
POJ 1159
Palindrome
地址:http://poj.org/problem?id=1159题意:将给定的字符串补成回文串至少添加几个字符。解法:1.将此字符串倒置,与原字符串匹配,则:添加字符=字符串长度-匹配字符个数2.如果DP开一个5000^2的静态数组是一定会超空间的,解决的办法是开一个二维滚动数组,这是这题的有一个关键。PS:一开始怎么测都不行,想不到居然是把1写成了i,坑爹的细节错误啊,糟心!!!#includ
biboyouyun
·
2013-01-17 23:00
上一页
95
96
97
98
99
100
101
102
下一页
按字母分类:
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
其他