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
USACO - 1.5.2 - Prime
Palindrome
s
原创文章转载请注明出处摘要:数论,质数,回文数一.题目翻译1.描述: 因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以151是回文质数。 写一个程序来找出范围[a,b](511){ jump1=true; } if(a>=1000){ jump1=true; jump3=true; } if(a>=100000){ jump1=true;
qingtangpaomian
·
2012-08-17 15:00
USACO
UVa 10716 - Evil Straw Warts Live
option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1657【原题】A
palindrome
isastringofsymbolsthatisequaltoitselfwhenreversed.Givenaninputstring
shuangde800
·
2012-08-17 00:00
2012 Multi-University Training Contest 7:
Palindrome
graph
Jackalsolovespainting.Helikestodrawmanyinterestinggraphicsonthepaper.Oneday,Jackfoundanewinterestinggraphcalled
Palindrome
graph.Nomatterhowmanytimestoflipor
duanxian0621
·
2012-08-15 20:00
struct
Integer
Graph
each
output
Training
USACO section 1.5 Prime
Palindrome
s(模拟)
Prime
Palindrome
s Thenumber151isaprime
palindrome
becauseitisbothaprimenumberanda
palindrome
(itisthesamenumberwhenreadforwardasbackward
nealgavin
·
2012-08-13 11:00
O(n)回文子串算法
原文地址:http://zhuhongcheng.wordpress.com/2009/08/02/a-simple-linear-time-algorithm-for-finding-longest-
palindrome
longshuai0821
·
2012-08-13 11:00
判断一个字符串是否是回文
判断一个字符串是否是回文#include #include /*判断用户输入的字符串是否为回文 *回文是指顺读和反读都一样的串 *例:abccba为回文,abcdab不是回文*/int
Palindrome
zongbao
·
2012-08-08 23:00
poj 1590
Palindrome
s
//这题需要考虑的情况也比较多,有点烦,一定需要用清晰的思路,要不很容易出错,尤其是对四种情况的讨论! //这题WA了两次,一次是:输出的英文写错了,是自己手打的,没有进行对样例的复制粘贴,下次要谨记! //第二次是没有讲‘O’和‘0’考虑进去,粗心了! #include #include usingnamespacestd; intmain() { inti,j,len; stringstr
yzl_rex
·
2012-08-06 14:00
String
System
UVa 401
Palindrome
s 字符串基础
题目链接:http://acm.hust.edu.cn:8080/judge/problem/viewProblem.action?id=19520 题目大意:给你一个字符串,一要你判断是否是回文串;二要把这个字符串的每一个字符按照给定的规则翻转,而然后判断翻转后的字符串是否是原串的逆序。 思路不难,但是有些地方要注意。首先要注意的一个问题是,大写字母O和
Jianquan
·
2012-08-06 00:00
ACM
uva
401
Palindromes
UVa 401
Palindrome
s 字符串基础
阅读更多题目链接:http://acm.hust.edu.cn:8080/judge/problem/viewProblem.action?id=19520题目大意:给你一个字符串,一要你判断是否是回文串;二要把这个字符串的每一个字符按照给定的规则翻转,而然后判断翻转后的字符串是否是原串的逆序。思路不难,但是有些地方要注意。首先要注意的一个问题是,大写字母O和数字0是一样的。这一点我觉得题目的表述
Jianquan
·
2012-08-06 00:00
UVa
401
Palindromes
acm
UVa 401
Palindrome
s 字符串基础
阅读更多题目链接:http://acm.hust.edu.cn:8080/judge/problem/viewProblem.action?id=19520题目大意:给你一个字符串,一要你判断是否是回文串;二要把这个字符串的每一个字符按照给定的规则翻转,而然后判断翻转后的字符串是否是原串的逆序。思路不难,但是有些地方要注意。首先要注意的一个问题是,大写字母O和数字0是一样的。这一点我觉得题目的表述
Jianquan
·
2012-08-06 00:00
UVa
401
Palindromes
acm
判断一个整数是否是回文数
数字转换为字符串可以通过itoa函数实现,判断字符串是否为回文字符串代码如下: bool is
Palindrome
(string &str) { int
qiemengdao
·
2012-07-29 16:00
判断
判断一个整数是否是回文数
数字转换为字符串可以通过itoa函数实现,判断字符串是否为回文字符串代码如下:boolis
Palindrome
(string&str) { intbegin=0,end=str.length()
ssjhust123
·
2012-07-29 16:00
String
div
DP:
Palindrome
Palindrome
TimeLimit:3000MS MemoryLimit:65536KTotalSubmissions:42770 Accepted:14582DescriptionA
palindrome
isasymmetricalstring
lethic
·
2012-07-23 03:00
String
Integer
input
output
[USACO]Palindromic Squares
PalindromicSquaresRobKolstad
Palindrome
sarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypical
palindrome
.GivenanumberbaseB
newlaide
·
2012-07-16 22:51
算法
USACO
string
integer
output
numbers
file
import
hdu 1513(
Palindrome
)
hdu1513(
Palindrome
) 1 #include 2 #include 3 #include 4 using namespace std; 5 #define MaxSize 5005
冰王子Leo与ACM一起的成长
·
2012-07-11 19:00
用clojure解决 euler problem 4
问题描述:Apalindromicnumberreadsthesamebothways.Thelargest
palindrome
madefromtheproductoftwo2-digitnumbersis9009
hotcharm
·
2012-07-07 21:00
clojure
F -
Palindrome
ter
DescriptionWhiledrivingtheotherday,Johnlookeddownathisodometer,anditread100000.Johnwasprettyexcitedaboutthat.But,justonemilefurther,theodometerread100001,andJohnwasREALLYexcited!Yousee,Johnlovespalind
zhjchengfeng5
·
2012-07-07 20:00
USCAO section 1.2 Dual
Palindrome
s
Dual
Palindrome
sMarioCruz(Colombia)&HugoRickeboer(Argentina) Anumberthatreadsthesamefromrighttoleftaswhenreadfromlefttorightiscalleda
palindrome
.Thenumber12321isa
palindrome
nealgavin
·
2012-07-05 21:00
USCAO section1.2 Palindromic Squares
PalindromicSquares RobKolstad
Palindrome
sarenumbersthatreadthesameforwardsasbackwards.Thenumber12321isatypical
palindrome
.GivenanumberbaseB
nealgavin
·
2012-07-04 09:00
struct
File
null
Integer
output
Numbers
java 回文判断
老师给的复习卷子,编程题的第一题是判断一个String对象是否是回文,如“level”就是回文 下面是我的实现: publicclassUtil{publicstaticbooleanis
Palindrome
zhx6044
·
2012-06-22 22:00
java
编程
String
null
Class
[搜索]USACO-1.5-Prime
Palindrome
s
Prime
Palindrome
sThenumber151isaprime
palindrome
becauseitisbothaprimenumberanda
palindrome
(itisthesamenumberwhenreadforwardasbackward
Coco_young
·
2012-06-19 21:00
USACO
【USACO-Chapter1-1.2】【进制转换】Dual
Palindrome
s
【题目描述】如果一个数从左往右读和从右往左读都是一样,那么这个数就叫做“回文数”。例如,12321就是一个回文数,而77778就不是。当然,回文数的首和尾都应是非零的,因此0220就不是回文数。事实上,有一些数(如21),在十进制时不是回文数,但在其它进制(如二进制时为10101)时就是回文数。编一个程序,从文件读入两个十进制数N(1 #include usingnamespacestd; cha
njlcazl
·
2012-06-17 20:00
Palindrome
The“U.S.Robots”HQhasjustreceivedaratheralarminganonymousletter.Itstatesthattheagentfromthecompeting«RobotsUnlimited»hasinfiltratedinto“U.S.Robotics”.«U.S.Robots»securityservicewouldhavealreadystarteda
struggle_mind
·
2012-06-17 20:00
USACO1.5 Prime
Palindrome
s(pprime)
题目中提示的很清楚,先求出回文数,然后检测该数是不是质数。具体实现如下:先求出a,b的位数wa,wb,再求出位数在[wa,wb]之间的所有回文质数存入set中并进行自动排序,其中可能有一些不在范围[a,b]中的数,只需打印出在[a,b]范围内的即可。 /* ID:jzzlee1 PROG:pprime LANG:C++ */ #include #include #include #
jzzlee
·
2012-06-14 15:00
USACO
programming with String
Question:1)WritecodetocheckaStringis
palindrome
ornot?
iloveflower
·
2012-06-12 01:00
programming
USACO1.2 Dual
Palindrome
s(dualpal)
从s的下一个数开始,依次检验是否在2~10进制的表示中,两种或两种以上表示形式是回文数,如果有两种就不必继续检测,直接输出这个数字。直到找到n个这样的数字。值得记一下的是这个题是第一个我首次提交即通过全部测试例的题目。下面是返回的信息:YOURPROGRAM('dualpal')WORKEDFIRSTTIME!That'sfantastic--andararething.Pleaseacc
jzzlee
·
2012-06-08 00:00
USACO
uva401 -
Palindrome
s
Aregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring"ABCDEDCBA"isa
palindrome
becauseitisthesamewhenthestringisreadfromlefttorightaswhenthestringisreadfromrig
Frankiller
·
2012-06-06 11:00
String
character
each
include
output
Numbers
poj1159 -
Palindrome
想看更多的解题报告:http://blog.csdn.net/wangjian8006/article/details/7870410 转载请注明出处:http://blog.csdn.net/wangjian8006题目大意:给出一个数字代表接下来给出一串
wangjian8006
·
2012-06-05 20:00
c
401 -
Palindrome
s
Palindrome
s Aregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring"ABCDEDCBA"isa
palindrome
becauseitisthesamewhenthestringisreadfromlefttorightaswhenthestring
zhuyi2654715
·
2012-05-29 01:00
String
character
each
include
output
Numbers
uva-401 -
Palindrome
s
这道题目也挺水的,题目说的很清楚,判断是不是mirroredstring的时候有些费事,但是也不算太费事。建立一个数组,满足a数组,同时也满足b数组既是mirroredstring。不过这道题目有个地方很恶心人,就是每组数据之间有个空行,在这里WA了一次,我有点疑问,uva怎么不判断PE啊,按照常理来说这样的错误应该是PE啊。#include #include intis_p(char*str)
rowanhaoa
·
2012-05-23 00:00
10453 - Make
Palindrome
/* 推荐:四星。 这道题做得时候有些害怕,没有仔细去想。 小感悟:动态规划题,试着去分析各个状态之间的联系,记住:去本上画出几个状态找其中的联系。这是关键,然后写出状态转移方程。 注意:①处,因为将==误写成了=,导致WA了N多次,一直找不到原因,因为测试结果始终正确。 题意:将字符串补全为回文数,问最少添加几个字母即可。 */ #include #include constintnM
lhshaoren
·
2012-05-01 10:00
测试
11151 - Longest
Palindrome
/* 简单题 求最长回文数,多阶段决策问题类动态规划 题意:字符串S中包含的最长回文数为多长。即删除若干个字母后,剩余为回文数,问长度最长为多少。 状态转移方程为:if(str[i]==str[j])f[i][j]=f[i+1][j-1]+2; elsef[i][j]=max(f[i+1][j],f[i][j-1]). */ //#defineTEST #include #include
lhshaoren
·
2012-04-30 20:00
欧拉计划第4题
The largest
palindrome
made from the product of two 2-digit numbers is 9009=91*99.
ll_0520
·
2012-04-30 19:00
null
回文数-使用指针
#include usingnamespacestd; boolis
Palindrome
(char*input) { if(input==NULL) { returnfalse; } // char*begin
bxyill
·
2012-04-29 10:00
null
input
include
Palindrome
pairs 动态规划
刚开始作道题我只是想到一个n四次方的算法 不敢打啊!!!后来和磊哥讨论讨论得到一个n二次方的算法 还可以就是计算出一i为尾节点的回文个数dp1[i],计算出以i为头节点的个数dp2[i],这样只要做相乘就可以啦这个事n方,之前处理dp1[i],dp2[i]也是n方的算法详细看代码吧!!!!#include #include #include usingnamespacestd; chara[200
youngyangyang04
·
2012-04-25 01:00
【面试】一道Java面试题
偶然在论坛上看到了一道面试题,题目如下: 问题: 如果给定的字符串从左到右和从右到左的序列完全一致,那么这样的字符串被称为
palindrome
。
yuanji
·
2012-04-23 09:00
Java面试题
USACO section 1.5.2 Prime
Palindrome
s
1.无数遍TLE的题,快疯了,最后没办法,只能看别人的代码,最好的一个代码,写了下来,但是还有一点地方不太明白,这是一种新的方法,以下是代码/* ID:dollar4 PROG:pprime LANG:C++ */ #include #include #include #include #include usingnamespacestd; intmodify(intx) { intt=x; x
dollarzhaole
·
2012-04-21 21:00
USACO Training Section 1.2 Dual
Palindrome
s 解题报告&AC代码
解题报告:这依然是一道可以用中规中矩方法做出来的题。我的方法是从start扫描到最大整数(2147483647,他说了不会超的么…),判断这个数是不是“双重回文”,如果是,输出这个数,计数器(就是那个输入的N)自减。当N==0的时候,我们的工作也就完成啦。至于判断的部分,从2扫描到10,对将要处理的数x转换成每一种进制分别判断(就是第i位== 第(n-i)位,假设K进制下这个数有n位的话),如果是
Moien_Podiene
·
2012-04-21 19:00
File
buffer
input
output
Training
Numbers
UVa OJ 回文词(401)
Palindrome
s Aregular
palindrome
isastringofnumbersorlettersthatisthesameforwardasbackward.Forexample,thestring"ABCDEDCBA"isa
palindrome
becauseitisthesamewhenthestringisreadfromlefttorightaswhenthestring
ultimater
·
2012-04-13 17:00
Palindrome
POJ 1159 动态规划
原文链接:http://www.cnblogs.com/JWMNEU/archive/2012/04/11/3069586.htmlDescriptionA
palindrome
isasymmetricalstring
weixin_34006468
·
2012-04-11 18:00
算法1
Astringisa
palindrome
ifithasexactlythesamesequenceofcharacterswhenreadleft-to-rightasithaswhenreadright-to-left.Forexample
xtuhcy
·
2012-04-11 17:00
算法
palindrome
Anagram
USACO section 1.2.4 Dual
Palindrome
s
1.直接用了上道题的函数,另外,进制转换:stringtrans(inta) { stringstr1=""; inttmp; while(a) { tmp=a%base; if(tmp #include #include #include #include usingnamespacestd; intn,s; boolcheckp(stringstr) { intlen=str.size();
dollarzhaole
·
2012-04-11 10:00
poj 1159
Palindrome
NYOJ 37 回文字符串(DP)
这道题有两种解法:第一种:求s和~s的LCS,然后套用公式length-LCS长度即为所求。第二种:直接DP求解。当s[i]==s[j]时 f[i][j]=f[i+1][j-1] 当s[i]!=s[j]时 f[i][j]=min(f[i+1][j],f[i][j-1])+1; 这个题我用的是一个大型的二维数组,代码很水,不建议欣赏。 #include#include#include#incl
C小加
·
2012-04-10 21:00
POJ-1590
#include #include intmain() { charstr[22]; inti,l; intmirrored,
palindrome
; while(scanf("%s",str)!
x_liushi_game
·
2012-04-07 23:00
zoj 2744
Palindrome
s
//这题主要是找回文字符串的个数,可以用DP来做(贴一下别人的代码,学习学习),也可以用分治方法做! //下面是参照别人的代码再自己实现的,因为之前接触的比较少,所以还不是很熟悉这些题的做法! //希望可以学到东西! #include"iostream" #include"string" usingnamespacestd; strings; intlen,count; voidis_palin
yzl_rex
·
2012-04-04 09:00
stdstring
POJ-1159(把一个字符串变成回文串需要多少步操作)(
Palindrome
)
/*==========================================================*\ |动态规划 |设ch[1]..ch[n]表示字符串1至n位,i为左游标,j为右游标,则i从n递减,j从i开始递增。 |min[i][j]表示i和j之间至少需要插入多少个字符才能对称,初始置全0, |我们最终需要得到的值是min[1][n]. |PS:short类型可以用%d
famousDT
·
2012-03-29 10:00
O(n)回文子串算法
原文地址:http://zhuhongcheng.wordpress.com/2009/08/02/a-simple-linear-time-algorithm-for-finding-longest-
palindrome
-sub-string
xsbailong
·
2012-03-23 11:00
算法
ini
回文字
回文字 如果给定的字符串从左到右和从右到左的序列完全一致,那么这样的字符串被称为
palindrome
。例如,下面的字符串都是
palindrome
s。
longcxm
·
2012-03-22 16:00
回文
java面试题
小弟java新手偶然在论坛上看到了一道面试题,题目如下:问题:如果给定的字符串从左到右和从右到左的序列完全一致,那么这样的字符串被称为
palindrome
。
lohasle
·
2012-03-20 13:00
java基础
Java面试
JAVA回文数的实现
Scannerinput=newScanner(System.in); System.out.print("Enterainterge:"); intnum=input.nextInt(); if(is
Palindrome
hacke2
·
2012-03-17 12:00
java
String
Class
input
import
上一页
97
98
99
100
101
102
103
104
下一页
按字母分类:
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
其他