
Acm for hdu
文章平均质量分 52
杭电oj各种算法题目
Rememberautumn
疯狂的爱好者,一个IT菜鸟的成长之路.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++结构体之统计最高最低分
[Submit][Status][Web Board]Description输入学生的姓名和成绩,统计出最高分的学生和最低分的学生。Input输入5个学生的姓名和分数,用结构体完成Output输出最高分的姓名和分数,最低分的姓名和分数Sample Inputwang 98.8 li 67.9 zhang 5原创 2014-03-14 17:01:42 · 2209 阅读 · 0 评论 -
sort和qsort排序
qsort(数组名,数组长度,数组中每个元素大小,compare); compare函数的写法决定了排序是升序还是降序。需要#include例如:int compare(const void*a,const void*b){return *(int*)a-*(int*)b;} 示例:qsort(a,10,sizeof(int),compare) //假设已定义了整型数组a[10]升原创 2014-03-15 17:17:25 · 1712 阅读 · 0 评论 -
The area面积计算
Problem DescriptionIgnatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now g原创 2014-03-15 20:33:05 · 1266 阅读 · 0 评论 -
Heritage from father
Problem DescriptionFamous Harry Potter,who seemd to be a normal and poor boy,is actually a wizard.Everything changed when he had his birthday of ten years old.A huge man called 'Hagrid' found Harr原创 2014-03-17 11:20:58 · 1279 阅读 · 0 评论 -
FatMouse' Trade
Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room con原创 2014-03-21 17:40:22 · 1214 阅读 · 1 评论 -
Children’s Queue
Children’s QueueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10040 Accepted Submission(s): 3198Problem DescriptionThere ar原创 2014-03-26 17:21:55 · 1661 阅读 · 1 评论 -
不容易系列之一
不容易系列之一Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 70 Accepted Submission(s) : 26Font: Times New Roman | Verdana | GeorgiaFo原创 2014-03-26 17:55:01 · 1009 阅读 · 1 评论 -
A Mathematical Curiosity
A Mathematical CuriosityTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 87 Accepted Submission(s) : 23Font: Times New Roman | Verdana | Ge原创 2014-04-19 17:08:53 · 1157 阅读 · 0 评论 -
Max Sum
Max SumTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 52 Accepted Submission(s) : 12Font: Times New Roman | Verdana | GeorgiaFont Size:原创 2014-04-19 17:09:46 · 1362 阅读 · 0 评论 -
Piggy-Bank
Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The原创 2014-04-25 17:37:41 · 969 阅读 · 0 评论 -
C语言实验——一元二次方程Ⅱ
C语言实验——一元二次方程ⅡTime Limit: 1 Sec Memory Limit: 64 MBSubmit: 169 Solved: 131[Submit][Status][Web Board]Description求一元二次方程ax2+bx+c=0的解。a,b,c为任意实数。Input输入数据有一行,包括a b c的值。Outp原创 2014-05-31 11:25:27 · 2600 阅读 · 0 评论 -
游起来吧!超妹!
游起来吧!超妹!Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 15 Solved: 7[Submit][Status][Web Board]Description夏天到了,无聊的超妹跑到了落雪湖里抓鱼吃。结果,游到湖的正中 央时被湖边保安看到了,保安要抓住超妹。我们假设落雪湖是一个半径为r的圆形,超妹在圆形的正中原创 2014-05-31 17:14:23 · 1255 阅读 · 0 评论 -
Wooden Sticks
Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It nee原创 2014-04-09 15:16:53 · 1530 阅读 · 1 评论 -
Tian Ji -- The Horse Racin
Tian Ji -- The Horse Racin Problem DescriptionHere is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play原创 2014-04-09 17:15:51 · 1192 阅读 · 1 评论 -
位图像素的颜色 携程编程大赛hdu
位图像素的颜色Time Limit: 2000/1000 MS (Java/Others) MemoryLimit: 32768/32768 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem Description有一个在位图上画出矩形程序,一开始位图都被初始化为白色原创 2014-04-11 20:12:25 · 1504 阅读 · 0 评论 -
钥匙计数之二
Problem Description一把钥匙有N个槽,2 Input本题无输入Output对2Sample OutputN=3: 104N=4: 904N=5: 5880.....N=25: 8310566473196300280#include#includeusing namespace std;in原创 2014-04-12 09:24:45 · 1661 阅读 · 0 评论 -
数塔 动态规划
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 Ou原创 2014-04-12 14:37:22 · 1268 阅读 · 0 评论 -
Common Subsequence
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there e原创 2014-04-12 16:55:03 · 1021 阅读 · 0 评论 -
Fire Net HDU
Fire Net Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 13 Accepted Submission(s) : 5Font: Times New Roman | Verdana | GeorgiaFont Si原创 2014-04-13 17:08:15 · 1448 阅读 · 1 评论 -
Super Jumping! Jumping! Jumping!
Super Jumping! Jumping! Jumping!Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 20 Accepted Submission(s) : 7Font: Times New Roman |原创 2014-04-14 10:42:57 · 962 阅读 · 1 评论 -
最少拦截系统
Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求原创 2014-04-14 18:38:44 · 1178 阅读 · 5 评论 -
搬寝室 hdu
Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和原创 2014-04-18 18:01:01 · 1422 阅读 · 0 评论 -
背包问题
杭电ACM 2014暑期集训队——选拔安排~Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25800 Accepted Submission(s): 10453原创 2014-04-19 13:03:49 · 1057 阅读 · 0 评论 -
背包九讲
P01: 01背包问题题目 有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。 基本思路 这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放。 用子问题定义状态:即f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。则其状态转移方程转载 2014-04-26 10:00:35 · 851 阅读 · 0 评论