![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hdu
zt_1995
这个作者很懒,什么都没留下…
展开
-
杭电 1003
Max sumProblem Description Given a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5转载 2015-04-30 14:19:30 · 304 阅读 · 0 评论 -
poj2533&&hdu1087 最长上升子序列问题
题目链接: http://poj.org/problem?id=2533 http://acm.hdu.edu.cn/showproblem.php?pid=1087最长上升子序列问题: 思路1:dp[i]表示以i结尾的最长上升子序列 转移方程:dp[i]=max{dp[j]+1}; 思路2:dp[i]表示长度为i的最小元素升序排列: iterator lower_bound( cons原创 2016-01-06 18:34:12 · 268 阅读 · 0 评论 -
hdu1203
I NEED A OFFER!Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Sp原创 2016-01-06 10:13:10 · 278 阅读 · 0 评论 -
hdu2955 dp(背包)
**Robberies**Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has d原创 2016-01-05 11:32:07 · 235 阅读 · 0 评论 -
hdu 3790 最短路
最短路径问题Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1Out原创 2016-01-06 10:03:31 · 240 阅读 · 0 评论 -
hdu1272(并查集)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1272思路: 1、判断所有点是否联通,用边数=顶点数-1 来判断 2、判断有没成环,用并查集来判断两个点是否联通,如果已经联通,则会成环。 3、特判 直接读入空图即,a==0&&b==0 输出Yes代码:#include<cstdio>#include<cstring>const int N=原创 2015-12-25 23:24:34 · 274 阅读 · 0 评论 -
hdu1548 最短路
**A strange lift**Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up a原创 2015-12-18 17:15:31 · 438 阅读 · 0 评论 -
hdu2066
一个人的旅行Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一原创 2015-12-18 12:22:45 · 317 阅读 · 0 评论 -
hdu 1102 prim算法
**Constructing Roads****Problem Description** There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two v原创 2015-12-18 11:31:59 · 237 阅读 · 0 评论 -
hdu3410 单调队列
**Passing the Message**Problem Description What a sunny day! Let’s go picnic and have barbecue! Today, all kids in “Sun Flower” kindergarten are prepared to have an excursion. Before kicking of原创 2015-12-22 11:07:10 · 306 阅读 · 0 评论 -
hdu3998 最长上升子序列及其个数 dp或dp+最大流
SequenceProblem DescriptionThere is a sequence X (i.e. x[1], x[2], …, x[n]). We define increasing subsequence of X as x[i1], x[i2],…,x[ik], which satisfies follow conditions: 1) x[i1] < x[i2],…,Input原创 2016-01-07 00:38:31 · 457 阅读 · 1 评论 -
hdu2571 简单dp
命运Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了! 可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑! 可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧! 命运大迷宫可以看成是一个两维的方格阵列,如下原创 2016-01-08 00:19:49 · 218 阅读 · 0 评论 -
hdu1069 最长上升子序列变形
Monkey and BananaProblem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the m原创 2016-01-09 00:11:57 · 267 阅读 · 0 评论 -
hdu5547 dfs
SudokuTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 646 Accepted Submission(s): 238Problem DescriptionYi Sima was one of the be原创 2016-01-29 13:45:57 · 585 阅读 · 0 评论 -
hdu5399 Too simple
*Problem Description* Rhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too simple, sometimes naive. So she ask you for help.Teacher Mai has原创 2015-08-18 20:25:06 · 408 阅读 · 0 评论 -
hdu1078 记忆化搜索
FatMouse and CheeseProblem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0原创 2016-01-25 11:26:23 · 231 阅读 · 0 评论 -
hdu1080
Human Gene FunctionsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2866 Accepted Submission(s): 1619Problem DescriptionIt is wel原创 2016-01-25 09:00:49 · 312 阅读 · 0 评论 -
hdu1160 dp+路径记录
FatMouse's SpeedTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12849 Accepted Submission(s): 5641Special JudgeProblem Description原创 2016-01-16 11:16:00 · 286 阅读 · 0 评论 -
hdu1978
How many waysProblem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点原创 2016-01-15 12:05:42 · 311 阅读 · 0 评论 -
hdu1421
搬寝室Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和原创 2016-01-15 00:40:15 · 243 阅读 · 0 评论 -
hdu1171 二进制优化背包问题
Big Event in HDUProblem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer Colleg原创 2016-01-09 11:06:55 · 253 阅读 · 0 评论 -
hdu2577
How to TypeProblem DescriptionPirates have finished developing the typing software. He called Cathy to test his typing software. She is good at thinking. After testing for several days, she finds that原创 2016-01-09 01:09:32 · 246 阅读 · 0 评论 -
hdu1426&3111 数独问题
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1426 http://acm.hdu.edu.cn/showproblem.php?pid=3111这两题均可用dfs即可 line[i][j] 记录第i行j数字有没有出现 row[i][j] 记录第i列j数字有没有出现 sqr[b[i][j]][k] 记录第i行第j列在其3*3方块中有无出现原创 2016-01-29 18:41:16 · 388 阅读 · 0 评论