上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

2013年7月17日

HDU 1041 Computer Transformation (简单大数)

摘要: Computer Transformationhttp://acm.hdu.edu.cn/showproblem.php?pid=1041Problem DescriptionA sequence consisting of one digit, the number 1 is initially written into a computer. At each successive time step, the computer simultaneously tranforms each digit 0 into the sequence 1 0 and each digit 1 into 阅读全文

posted @ 2013-07-17 07:29 圣手摘星 阅读(258) 评论(0) 推荐(0)

2013年7月16日

HDU 2159 FATE (二维完全背包

摘要: FATEhttp://acm.hdu.edu.cn/showproblem.php?pid=2159Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?Input输入数据有多组,对于每组数据第一行输入n,m,k,s(0 #i 阅读全文

posted @ 2013-07-16 11:11 圣手摘星 阅读(214) 评论(0) 推荐(0)

HDU 2084 数塔(动态规划)

摘要: 数塔http://acm.hdu.edu.cn/showproblem.php?pid=2084Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAX =... 阅读全文

posted @ 2013-07-16 08:26 圣手摘星 阅读(597) 评论(0) 推荐(0)

2013年7月15日

HDU 2059 龟兔赛跑(动态规划)

摘要: 龟兔赛跑Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8553Accepted Submission(s): 3283Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。最近正值HDU举办50周年校庆,社会 阅读全文

posted @ 2013-07-15 22:21 圣手摘星 阅读(310) 评论(0) 推荐(0)

HDU 1978 How many ways(动态规划)

摘要: How many wayshttp://acm.hdu.edu.cn/showproblem.php?pid=1978Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。如上图,机器人一开始在(1,1)点,并拥有4单位能量,蓝色方块表示他所能到达的点,如果他在这次路径选择中选 阅读全文

posted @ 2013-07-15 20:25 圣手摘星 阅读(237) 评论(0) 推荐(0)

HDU 1789 Doing Homework again (贪心)

摘要: Doing Homework againhttp://acm.hdu.edu.cn/showproblem.php?pid=1789Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after the deadline, the 阅读全文

posted @ 2013-07-15 16:59 圣手摘星 阅读(256) 评论(0) 推荐(0)

HDU 1421 搬寝室

摘要: 搬寝室Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12604Accepted Submission(s): 4220Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n 阅读全文

posted @ 2013-07-15 11:30 圣手摘星 阅读(190) 评论(0) 推荐(0)

HDU 1284 钱币兑换问题

摘要: 钱币兑换问题Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4006Accepted Submission(s): 2274Problem Description在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。Input每行只有一个正整数N,N小于32768。Output对应每个输入,输出兑换方法数。Sample Input293412553Sample Output71883113137761 阅读全文

posted @ 2013-07-15 09:50 圣手摘星 阅读(136) 评论(0) 推荐(0)

HDU 1260 Tickets(简单dp)

摘要: TicketsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 711Accepted Submission(s): 354Problem DescriptionJesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets 阅读全文

posted @ 2013-07-15 09:19 圣手摘星 阅读(166) 评论(0) 推荐(0)

2013年6月28日

高精度浮点型数据加,减,乘运算

摘要: 大正数加法代码:(适用高精度浮点型,减法,乘法同样适用) 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define CLE(name) memset(name, 0, sizeof (name)) 7 const int max_n = 1010; 8 9 int num1[max_n], num2[max_n];10 11 int main ()12 {13 string str1, str2;14 int len1, len2;15 int tag1, tag2... 阅读全文

posted @ 2013-06-28 00:21 圣手摘星 阅读(481) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

导航