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
杭电OJ刷题
【搜索之BFS + 优先队列】
杭电
hdu 1026 Ignatius and the Princess I
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : htt
panyanyany
·
2012-04-02 12:00
搜索
优先队列
bfs
广搜
宽搜
【搜索之BFS + 优先队列】
杭电
hdu 1026 Ignatius and the Princess I
/*THEPROGRAMISMADEBYPYY*/ /*----------------------------------------------------------------------------// Copyright(c)2012panyanyanyAllrightsreserved. URL:http://acm.hdu.edu.cn/showproblem.php?pid=1
panyanyany
·
2012-04-02 12:00
【搜索之BFS + 优先队列】
杭电
hdu 1026 Ignatius and the Princess I
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://acm.hdu
txf2004
·
2012-04-02 12:00
杭电 hdu
杭电
hdu 1075 What Are You Talking About 字典树的应用
http://acm.hdu.edu.cn/showproblem.php?pid=1075经过前两个字典树的学习运用,现在在它们的基础上做了这个题,其代码贴在下面,供我以后再回首时能想起。//字典树 #include #include #include typedefstruct_node { charenglish[12]; _node*next[26]; }node; staticnod
wchyumo2009
·
2012-04-01 19:00
c
struct
null
search
insert
【搜索之BFS】
杭电
hdu 1548 A strange lift
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL
panyanyany
·
2012-04-01 18:00
搜索
bfs
【搜索之BFS】
杭电
hdu 1548 A strange lift
/*THEPROGRAMISMADEBYPYY*/ /*----------------------------------------------------------------------------// Copyright(c)2012panyanyanyAllrightsreserved. URL:http://acm.hdu.edu.cn/showproblem.php?pid=1
panyanyany
·
2012-04-01 18:00
【搜索之BFS】
杭电
hdu 1548 A strange lift
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://acm.hdu
txf2004
·
2012-04-01 18:00
杭电 hdu
杭电
1829 A Bug's Life 经典并查集
卧槽,写这道题写了两天啊,,,两天啊,,,容易吗。。。搞基的bug伤不起啊。。。。并查集扩展,题目:ABug'sLifeTimeLimit:15000/5000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):3921 AcceptedSubmission(s):1266ProblemDe
wmn_wmn
·
2012-03-31 16:00
input
each
output
bugs
behavior
Numbers
ACM入门之
杭电
1045:Fire Net C++解法
FireNet地址:http://acm.hdu.edu.cn/showproblem.php?pid=1045TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):2957 AcceptedSubmission(s):1700ProblemDescripti
Cannel_2020
·
2012-03-31 01:00
C++
search
input
each
output
distance
用python抓取oj题目(1)——用beautifulsoup分析oj元素
btw:原来django的静态文件是这么个意思啊,这个以后再说、、、首先点开
杭电
的网址,找到problemarchi
·
2012-03-30 22:00
python
杭电
3791 搜索二叉树
话说这道题是一个恶心啊,,,试了各种各样的方法,各种各样的错误都犯了,,从wa再到离奇的re,,,各种恶心啊。。。最后还是用数组模拟过了。。。题目:二叉搜索树TimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):854 AcceptedSubmission
wmn_wmn
·
2012-03-29 14:00
String
input
output
杭电
1710 二叉树
这道题是给出你二叉树的中序遍历和前序遍历,让求后序遍历。思路很简单,先建立一颗二叉树,之后再后序遍历二叉树即可。题目:BinaryTreeTraversalsTimeLimit:1000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):1326 AcceptedSubmissio
wmn_wmn
·
2012-03-28 18:00
tree
Integer
input
each
output
traversal
杭电
hdu 1247 hat's words
http://acm.hdu.edu.cn/showproblem.php?pid=1247字典树的又一简单题,简单介绍见本目录中的另一个题。//字典树的应用问题 #include #include #include #defineMAX51 charwords[50001][MAX];//缓存所有输入的单词 typedefstruct_node { boolend; _node*next[
wchyumo2009
·
2012-03-28 12:00
杭电
4006 multiset 妙用
用stl可以解决。。题目:ThekthgreatnumberTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65768/65768K(Java/Others)TotalSubmission(s):2574 AcceptedSubmission(s):1119ProblemDescriptionXiaoMingandXiaoBaoarep
wmn_wmn
·
2012-03-27 15:00
杭电
1031 结构体排序
这道题题意有点晦涩,读了很久才明白。结果提交确实wa,,让我一度怀疑自己理解错题意了,后来又仔细看了看程序,发现了一个bug,改过后就ac了。题意就是求n个数的前k个,但是还有另一个属性序号,序号从小到大排序即可。题目:DesignT-ShirtTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)
wmn_wmn
·
2012-03-27 11:00
Algorithm
struct
input
each
bbs
output
杭电
1251 统计难题 字典树的应用
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1251初拿到这个题时,感觉是简单的题,想要对单词进行简单的存储,并且在比较时,进行遍历比较,如果数据量很大的话,就需要很长的时间来遍历。进过网上的搜索,我知道了还有字典树的概念,可以对大量的单词进行哈希存储,并且以此存储后,直接遍历一个树的分支就能得到最终的结果,感觉速度能快很多,只是牺牲了很大的内存空
wchyumo2009
·
2012-03-25 13:00
杭电
1568 NYOJ 461 Fibonacci
题目让求Fibonacci数列的高四项,我们可知,一个数的n次方,若n=2.5,则其大小决定于n的整数部分即2,其小数点位置决定于n的小数部分即0.5。同理,Fibonacci数列也是这样,根据Fibonacci数列的通项公式,再转化为对数,就可以转化为上述问题。。题目:又见Fibonacci数列时间限制:1000 ms | 内存限制:65535 KB难度:4描述 数学神童小明终于把0到100
wmn_wmn
·
2012-03-23 21:00
杭电
3306 Another kind of Fibonacci 构造矩阵二分幂
这道题题意是比较简单的,方法也很容易想,构建矩阵,主要难度在构建矩阵的地方。由于A(n)=x*A(n-1)+Y*(n-2),因此可以把A(n)平方,再由S(n)=S(n-1)+A(n)*A(n),所以可以构建矩阵{A(n-2)*A(n-2),A(n-1)*A(n-1),A(n-1)*A(n-2),S(n-1)},{A(n-1)*A(n-1),A(n)*A(n),A(n-1)*A(n),S(
wmn_wmn
·
2012-03-23 17:00
杭电
hdu 3038 how many answers are wrong 并查集求解
http://acm.hdu.edu.cn/showproblem.php?pid=3038经过网上的搜罗,基本上明白了这个题的意思,网站http://hi.baidu.com/fp_lv/blog/item/a471530a86df7b90d53f7c2c.html讲解的很清楚,我这里只记录下网址和我的代码,以便以后随时查看。#include #defineMAX200001 intfathe
wchyumo2009
·
2012-03-23 10:00
JOIN
c
BI
存储
杭电
1431 素数回文
求5到100000000以内的回文素数,暴力就可以过了。。。。。题目:素数回文TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):5134 AcceptedSubmission(s):1170ProblemDescriptionxiaoou33对既是素
wmn_wmn
·
2012-03-22 19:00
杭电
1397 水题
一道很水的题,题目:Goldbach'sConjectureTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):2805 AcceptedSubmission(s):1040ProblemDescriptionGoldbach'sConjecture:F
wmn_wmn
·
2012-03-22 00:00
hdoj1162 Eddy's picture
不知道
杭电
上什么时候能出题的时候把英语水平提高一下~prim,直接贴代码:/* Hdoj:1162Eddy'spicture */ #include #include #include #include
stormdpzh
·
2012-03-20 19:00
杭电
1395 2^x mod n = 1 暴力题
一直以为有什么高深的算法,,没想到暴力一下就能过。。这太悲剧了。可以用欧拉定理证明其存在性。欧拉定理是这样的,如果a和m互质且a0)thatsatisfies2^xmodn=1. InputOnepositiveintegeroneachline,thevalueofn. OutputIftheminimumxexists,printalinewith2^xmodn=1.Print2^?mo
wmn_wmn
·
2012-03-20 08:00
算法
Integer
input
each
output
NYOJ 469 擅长排列的小明 II
然后发现题目给的数据最大是55,才回想起在
杭电
水题时题目数据都是20左右,下次长个记性吧。 刚看了解题报告,有点明白了。 学长说是dp问题,不过我不知道为什么是dp,只是明白了他的规律。
lovnet
·
2012-03-19 15:00
OJ
NYOJ 469 擅长排列的小明 II
然后发现题目给的数据最大是55,才回想起在
杭电
水题时题目数据都是20左右,下次长个记性吧。刚看了解题报告,有点明白了。学长说是dp问题,不过我不知道为什么是dp,只是明白了他的规律。
dgq8211
·
2012-03-19 14:00
杭电
2091
#include"stdio.h" intmain(intargc,char*argv[]) { charch; intle,ri,index,bottom,flag=0; while(scanf("%c%d",&ch,&index)&&ch!='@') { if(flag==1) { printf("\n"); } bottom=2*index-1; le=ri=in
midle110
·
2012-03-19 11:00
杭电
ACN 1282 回文数猜想
http://acm.hdu.edu.cn/showproblem.php?pid=1282如果用字符串的话,就是这样:#include #include usingnamespacestd; stringrev(stringn) { intnlen=n.length(); stringb(n); for(inti=0;i=0;j--,l--)max[l]+=min[j]-'0'; for(j=l
xujinsmile
·
2012-03-19 00:00
杭电
ACM 1008 Elevator
http://acm.hdu.edu.cn/showproblem.php?pid=1008电梯问题,好弱智的一道题~~#include usingnamespacestd; intmain(){ intT; cin>>T; intm,pre,time; while(T){ pre=0;time=0; for(inti=0;i>m; if(m-pre>T; } }
xujinsmile
·
2012-03-18 15:00
杭电
ACM 1228 A + B
http://acm.hdu.edu.cn/showproblem.php?pid=1228这道题没有算法,有点罗嗦~~其实就是字符串转换成int出于无奈,用了goto语句,但最后确实通过了~~幸运~~#include #include usingnamespacestd; intchan(stringa,stringb){ intnum=0; if(a=="zero") num+=0; if(
xujinsmile
·
2012-03-18 13:00
杭电
ACM 1297 Children’s Queue
http://acm.hdu.edu.cn/showproblem.php?pid=1297这道题是排序问题,可以用递归方法解决。计算F(n):一:当最后一个是男孩M时候,前面n-1个随便排出来,只要符合规则就可以,即是F(n-1);二:当最后一个是女孩F时候,第n-1个肯定是女孩F,这时候又有两种情况: 1)前面n-2个可以按n-2个的时候的规则来,完全可以,即是F(n-2); 2)
xujinsmile
·
2012-03-18 11:00
杭电
1019 简单数学题
就是一道简单数学题,求多个数的最小公倍数。。。题目:LeastCommonMultipleTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):14953 AcceptedSubmission(s):5562ProblemDescriptionTheleas
wmn_wmn
·
2012-03-18 10:00
Integer
input
each
n2
output
Numbers
杭电
ACM 1290 献给
杭电
五十周年校庆的礼物
http://acm.hdu.edu.cn/showproblem.php?pid=1290这道题和直线划分一个平面有异曲同工之处。直线划分平面公式是:F(n)=F(n-1)+n-1; 化简为:F(n)=1+(n-1)*n/2要想使这四个平面分空间为最多部分就要使这三条交线分一个平面为最多部分。我在这里找到了一个很详细的答案~~http://hi.baidu.com/lileiyang12/blo
xujinsmile
·
2012-03-18 00:00
杭电
ACM 2045 不容易系列之(3)—— LELE的RPG难题 (有问题)
http://acm.hdu.edu.cn/showproblem.php?pid=2045ProblemDescription人称“AC女之杀手”的超级偶像LELE最近忽然玩起了深沉,这可急坏了众多“Cole”(LELE的粉丝,即"可乐"),经过多方打探,某资深Cole终于知道了原因,原来,LELE最近研究起了著名的RPG难题:有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green
xujinsmile
·
2012-03-17 23:00
测试
input
fun
output
杭电
ACM 1017 A Mathematical Curiosity
http://acm.hdu.edu.cn/showproblem.php?pid=1017这道题真蛋疼,读题读的我晕乎乎的~~题目大意是先输入一个数N然后会分N块输入,每块每次输入2个数,n,m,n=m=0时结束,当a和b满足0 usingnamespacestd; intmain(){ intn,m,cont=0,num=0; intT; cin>>T; while(T--) { while(
xujinsmile
·
2012-03-17 21:00
杭电
ACM 1002 A + B Problem II
http://acm.hdu.edu.cn/showproblem.php?pid=1002这是一个大数相加问题,真是困扰我多年啊~~。。。。。。不知道下次做的时候能不能快速做出来~~废话少说,上代码:#include #include #defineMAX1000 usingnamespacestd; intmain(){ inti,j,T,cont=0; cin>>T; intA[MAX]={
xujinsmile
·
2012-03-17 17:00
c
杭电
ACM 2046 骨牌铺方格
http://acm.hdu.edu.cn/showproblem.php?pid=2046这道题是典型的递归问题,但是我调试的时候发现,当数字是40+的时候数字太大了,运算时间总是超出限制,故,一次都做出来~~免得一次一次总是递归~~#include usingnamespacestd; intmain(){ intn; longlongFun[51]; while(cin>>n){ Fun[1
xujinsmile
·
2012-03-17 14:00
杭电
ACM 2050 折线分割平面
http://acm.hdu.edu.cn/showproblem.php?pid=2050平面上有n条折线,问这些折线最多能将平面分割成多少块?看到过一到比较简单的类似体秘,说的是n条直线能将平面分割成多少块。答案是1+(1+n)*n/2.我们可以把n条折线看成2*n条直线,只不过每2条直线和一条折线相比都少分割了2个平面。所以不仅把前一个公示的n变成2n,还要再减去2n,所以公式成了1+(1+
xujinsmile
·
2012-03-17 11:00
杭电
ACM 1201 18岁生日
http://acm.hdu.edu.cn/showproblem.php?pid=1201#include usingnamespacestd; intYDays(int); intLeapyear(int); intmain(){ inty,m,d,sum=0; charstr[100]; intT; cin>>T; while(T--){ sum=0; cin>>str; y=(str[0]
xujinsmile
·
2012-03-17 00:00
杭电
ACM 1013 Digital Roots
http://acm.hdu.edu.cn/showproblem.php?pid=1013这道题是求一个正数的根(digitalroot),各个位数不断相加知道取得个数。首先,我想到的是把int型的数变成char数组。用itoa()函数。#include #include usingnamespacestd; intmain(){ intn,sum=0; charstr[100]; while(
xujinsmile
·
2012-03-16 21:00
c
buffer
扩展
编译器
杭电
ACM 1018 Big Number
http://acm.hdu.edu.cn/showproblem.php?pid=1018题意是求一个数的阶乘之后得数的位数。简单一点的话,如果要求的数很小的话,简单的递归算出阶乘,然后数数位数就可以,以下:#include #include #include usingnamespacestd; longFac(int); intmain(){ inta; cin>>a; char*str=n
xujinsmile
·
2012-03-16 17:00
算法
杭电
ACM 1001,1040,1096
http://acm.hdu.edu.cn/showproblem.php?pid=1001 #include usingnamespacestd; intmain(){ longintn,sum=0; while(cin>>n){ for(inti=0;i usingnamespacestd; intmain(){ intT,N,a[1000],n; cin>>T; while(T--){ ci
xujinsmile
·
2012-03-16 16:00
c
String
ini
buffer
杭电
2097
#include"stdio.h" intfun(intindex,intk); intmain(intargc,char*argv[]) { intindex; intk10,k16,k12; while(scanf("%d",&index)==1&&index!=0) { k10=fun(index,10); k16=fun(index,16); k12=fun(ind
midle110
·
2012-03-16 08:00
include
fun
杭电
2036
#include"stdio.h" typedefstructkks { intx; inty; }lists; intmain(intargc,char*argv[]) { intindex; listsms[101]; while(scanf("%d",&index)) { if(index==0) { break; } else { for(int
midle110
·
2012-03-16 07:00
struct
include
杭电
1719 简单数学题
这道题经过推导之后可以得到n=2^x*3^y-1,凡是形如这样的数都是friend数,,之后程序就简单了,需要注意的是0不是friend数。。。。题目:FriendTimeLimit:1000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):998 AcceptedSubmi
wmn_wmn
·
2012-03-16 07:00
一个人的旅行 (最短路径)
CrawlingfailedTimeLimit:1000MSMemoryLimit:32768KB64bitIOFormat:%I64d&%I64uSubmitStatusDescription虽然草儿是个路痴(就是在
杭电
待了一年多
DawnNext
·
2012-03-15 20:21
职场
休闲
最短路径
杭电
2899 数学 牛顿迭代法
第一次写这样的题目,写出来很有成就感啊。用二分法和牛顿迭代法都可以解决。题目:StrangefuctionTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):739 AcceptedSubmission(s):566ProblemDescriptionN
wmn_wmn
·
2012-03-04 16:00
杭电
2897 水题 数学
苍天啊,终于让我发现一道水题啊,内牛满面啊。。。。。。。题目:邂逅明下TimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):762 AcceptedSubmission(s):355ProblemDescription当日遇到月,于是有了明。当我遇到
wmn_wmn
·
2012-03-04 14:00
【巴什博弈】
杭电
hdu 1846 Brave Game
/*THEPROGRAMISMADEBYPYY*/ /*----------------------------------------------------------------------------// Copyright(c)2012panyanyanyAllrightsreserved. URL:http://acm.hdu.edu.cn/showproblem.php?pid=1
panyanyany
·
2012-03-04 10:00
【巴什博弈】
杭电
hdu 1846 Brave Game
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2012 panyanyany All rights reserved. URL : http://acm.hdu
txf2004
·
2012-03-04 10:00
杭电 hdu
杭电
4165 卡特兰数
杭电
热身赛第二场,,是一道裸的卡特兰数的题,题目:PillsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java
wmn_wmn
·
2012-03-03 19:00
Integer
Random
input
character
output
stdstring
上一页
112
113
114
115
116
117
118
119
下一页
按字母分类:
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
其他