- 博客(71)
- 资源 (15)
- 收藏
- 关注
原创 HDU1678:Shopaholic
Problem DescriptionLindsay is a shopaholic. Whenever there is a discount of the kind where you can buy three items and only pay for two, she goes completely mad and feels a need to buy all items in
2013-04-27 21:32:17 1233
原创 HDU1673:Optimal Parking
Problem DescriptionWhen shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs.Can you help Michael choose a place to park which mini
2013-04-27 21:18:23 1392
原创 HDU1334:Perfect Cubes
Problem DescriptionFor hundreds of years Fermat's Last Theorem, which stated simply that for n > 2 there exist no integers a, b, c > 1 such that a^n = b^n + c^n, has remained elusively unproven. (A
2013-04-27 20:56:35 1696
原创 HDU1302:The Snail
Problem DescriptionA snail is at the bottom of a 6-foot well and wants to climb to the top. The snail can climb 3 feet while the sun is up, but slides down 1 foot at night while sleeping. The snail
2013-04-27 19:43:22 1862
原创 HDU2511:汉诺塔 X
Problem Description1,2,...,n表示n个盘子.数字大盘子就大.n个盘子放在第1根柱子上.大盘不能放在小盘上.在第1根柱子上的盘子是a[1],a[2],...,a[n]. a[1]=n,a[2]=n-1,...,a[n]=1.即a[1]是最下面的盘子.把n个盘子移动到第3根柱子.每次只能移动1个盘子,且大盘不能放在小盘上.问第m次移动的是哪一个盘子,从哪根柱子移到哪根柱子
2013-04-27 15:08:50 2053
原创 HDU1570:A C
Problem DescriptionAre you excited when you see the title "AC" ? If the answer is YES , AC it ;You must learn these two combination formulas in the school . If you have forgotten it , see the pi
2013-04-27 01:31:45 1744
原创 HDU1339:A Simple Task
Problem DescriptionGiven a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p.ExampleFor n = 24, o = 3 and p = 3.TaskWrite a program which
2013-04-27 01:10:41 1152
原创 HDU1196:Lowest Bit
Problem DescriptionGiven an positive integer A (1 For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.Another example g
2013-04-27 00:47:14 1786
原创 HDU2175:汉诺塔IX
Problem Description1,2,...,n表示n个盘子.数字大盘子就大.n个盘子放在第1根柱子上.大盘不能放在小盘上. 在第1根柱子上的盘子是a[1],a[2],...,a[n]. a[1]=n,a[2]=n-1,...,a[n]=1.即a[1]是最下 面的盘子.把n个盘子移动到第3根柱子.每次只能移动1个盘子,且大盘不能放在小盘上. 问第m次移动的是那一个盘子.
2013-04-26 20:51:45 1832
原创 HDU1997:汉诺塔VII
Problem Descriptionn个盘子的汉诺塔问题的最少移动次数是2^n-1,即在移动过程中会产生2^n个系列。由于发生错移产生的系列就增加了,这种错误是放错了柱子,并不会把大盘放到小盘上,即各柱子从下往上的大小仍保持如下关系 : n=m+p+qa1>a2>...>amb1>b2>...>bpc1>c2>...>cqai是A柱上的盘的盘号系列,bi是B柱上的盘的盘号
2013-04-26 19:50:33 1595 2
原创 HDU1996:汉诺塔VI
Problem Descriptionn个盘子的汉诺塔问题的最少移动次数是2^n-1,即在移动过程中会产生2^n个系列。由于发生错移产生的系列就增加了,这种错误是放错了柱子,并不会把大盘放到小盘上,即各柱子从下往上的大小仍保持如下关系 :n=m+p+q a1>a2>...>amb1>b2>...>bpc1>c2>...>cq计算所有会产生的系列总数.
2013-04-26 13:01:28 1412
原创 HDU1995:汉诺塔V
Problem Description用1,2,...,n表示n个盘子,称为1号盘,2号盘,...。号数大盘子就大。经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并
2013-04-26 12:57:52 2204
原创 HDU2077:汉诺塔IV
Problem Description还记得汉诺塔III吗?他的规则是这样的:不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到小盘的上面。xhd在想如果我们允许最大的盘子放到最上面会怎么样呢?(只允许最大的放在最上面)当然最后需要的结果是盘子从小到大排在最右边。 Input输入数据的第一行是一个数据T,表示有T组数据。每
2013-04-25 22:19:07 1517
原创 HDU2064:汉诺塔III
Problem Description约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动一个盘,且不允许大盘放在小盘的上面。现在我们改变游戏的玩法,不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到下盘的上
2013-04-25 22:05:24 1169
原创 HDU1207;汉诺塔II
Problem Description经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一回只能移动一个圆盘。有预言说,这件事完成时宇宙
2013-04-25 21:43:53 1607
原创 HDU1335:Basically Speaking
Problem DescriptionThe Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company th
2013-04-25 20:36:21 1296
原创 HDU1390:Binary Numbers
Problem DescriptionGiven a positive integer n, find the positions of all 1's in its binary representation. The position of the least significant bit is 0.ExampleThe positions of 1's in the
2013-04-25 16:25:34 1636
原创 HDU1391:Number Steps
Problem DescriptionStarting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0
2013-04-25 16:09:01 1142
原创 HDU1465:不容易系列之一
Problem Description大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了!做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把40个单项选择题全部做错了!大家都学过概率论,应该知道
2013-04-24 17:42:26 944
原创 HDU1165:Eddy's research II
Problem DescriptionAs is known, Ackermann function plays an important role in the sphere of theoretical computer science. However, in the other hand, the dramatic fast increasing pace of the functio
2013-04-23 16:19:34 1006
原创 HDU1718:Rank
Problem DescriptionJackson wants to know his rank in the class. The professor has posted a list of student numbers and marks. Compute Jackson’s rank in class; that is, if he has the top mark(or is t
2013-04-23 15:32:46 1784
原创 hdu1098:Ignatius's puzzle
Problem DescriptionIgnatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that:f(x)=5*x^13+13*x^5+k*a*x,input a nonegative intege
2013-04-20 20:28:15 1919
原创 HDU2719:The Seven Percent Solution
Problem DescriptionUniform Resource Identifiers (or URIs) are strings like http://icpc.baylor.edu/icpc/, mailto:foo@bar.org, ftp://127.0.0.1/pub/linux, or even just readme.txt that are used to ident
2013-04-17 22:04:24 2293 1
原创 HDU1976:Software Version
Problem Description相信大家一定有过在网上下载软件而碰到多个不同版本的情况。一般来说,软件的版本号由三个部分组成,主版本号(Major Version Number),子版本号(Minor Version Number)和修订号(Revision_Number)。当软件进行了重大的修改时,主版本号加一;当软件在原有基础上增加部分功能时,主版本号不变,子版本号加一;当软
2013-04-17 20:28:38 1152
原创 HDU1977:Consecutive sum II
Problem DescriptionConsecutive sum come again. Are you ready? Go ~~1 = 0 + 12+3+4 = 1 + 85+6+7+8+9 = 8 + 27…You can see the consecutive sum can be representing like that. The nth li
2013-04-17 20:05:24 1416
原创 HDU1985:Conversions
Problem DescriptionConversion between the metric and English measurement systems is relatively simple. Often, it involves either multiplying or dividing by a constant. You must write a program that
2013-04-17 10:43:58 1314
原创 HDU1009: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 conta
2013-04-16 22:08:53 7835 1
原创 HDU1212:Big Number
Problem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier,
2013-04-16 21:31:12 2660 1
原创 POJ3628:Bookshelf 2【01背包】
DescriptionFarmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top.FJ has N cows (1
2013-04-16 16:30:01 1433
原创 POJ3624:Charm Bracelet【01背包】
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from theN (1 ≤N ≤ 3,402) available charms. Eac
2013-04-16 15:28:31 4120
原创 HDU1326:Box of Bricks
Problem DescriptionLittle Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. ``Look, I've built a wall!'', he tells his older sister
2013-04-16 15:14:03 3958
原创 HDU1431:素数回文
Problem Descriptionxiaoou33对既是素数又是回文的数特别感兴趣。比如说151既是素数又是个回文。现在xiaoou333想要你帮助他找出某个范围内的素数回文数,请你写个程序找出 a 跟b 之间满足条件的数。(5 Input这里有许多组数据,每组包括两组数据a跟b。 Output对每一组数据,按从小到大输出a,b之间所有满足条件的素数
2013-04-16 15:10:24 3167
原创 HDU1323:Perfection
Problem DescriptionFrom the article Number Theory in the 1994 Microsoft Encarta: "If a, b, c are integers such that a = bc, a is called a multiple of b or of c, and b or c is called a divisor or fac
2013-04-15 21:27:16 1943
原创 HDU1052:Tian Ji -- The Horse Racing
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 horse racing with the king an
2013-04-15 19:43:59 2241 1
原创 HDU2955:Robberies(01背包)
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 decided to
2013-04-14 21:22:55 1537
原创 HDU2639:Bone Collector II(01背包)
Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't mat
2013-04-14 20:54:50 1131
原创 HDU1283:最简单的计算机
Problem Description一个名叫是PigHeadThree的研究组织设计了一台实验用的计算机,命名为PpMm。PpMm只能执行简单的六种命令A,B,C,D,E,F;只有二个内存M1,M2;三个寄存器R1,R2,R3。六种命令的含义如下: 命令A:将内存M1的数据装到寄存器R1中; 命令B:将内存M2的数据装到寄存器R2中; 命令C:将寄存器R3的数据装到内存M1
2013-04-14 19:44:31 1156
原创 HDU1282:回文数猜想
Problem Description一个正整数,如果从左向右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数。任取一个正整数,如果不是回文数,将该数与他的倒序数相加,若其和不是回文数,则重复上述步骤,一直到获得回文数为止。例如:68变成154(68+86),再变成605(154+451),最后变成1111(605+506),而1111是回文数。于是有数学家提出一个猜
2013-04-13 22:25:11 1240
原创 HDU1266:Reverse Number
Problem DescriptionWelcome to 2006'4 computer college programming contest!Specially, I give my best regards to all freshmen! You are the future of HDU ACM! And now, I must tell you that ACM prob
2013-04-13 22:12:41 1108
原创 HDU1202:The calculation of GPA
Problem Description每学期的期末,大家都会忙于计算自己的平均成绩,这个成绩对于评奖学金是直接有关的。国外大学都是计算GPA(grade point average) 又称GPR(grade point ratio),即成绩点数与学分的加权平均值来代表一个学生的成绩的。那么如何来计算GPA呢? 一般大学采用之计分法 A90 - 100 4 点 B80 - 8
2013-04-13 22:05:19 2486 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人