
HDUOJ题解
weymin
make it easier
展开
-
HDU 4086
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4864Problem DescriptionToday the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhile, this task has a difficulty l原创 2015-08-17 00:59:14 · 621 阅读 · 0 评论 -
HDU 1753 大明A+B(大数加法,数组模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1753Problem Description话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。现在,给你两个正的小数A和B,你的任务是代表大明计算出A+B的值。原创 2015-08-19 01:59:32 · 1437 阅读 · 0 评论 -
HDU 1302 The Snail
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1302Problem 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原创 2015-08-19 11:28:48 · 510 阅读 · 0 评论 -
HDU 1789 Doing Homework again
题目链接:http://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 dea原创 2015-09-09 23:01:15 · 421 阅读 · 0 评论 -
HDU 5427 A problem of sorting
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5427Problem DescriptionThere are many people's name and birth in a list.Your task is to print the name from young to old.(There is no pair of two h原创 2015-09-09 12:25:39 · 559 阅读 · 0 评论 -
HDU 1304 A Contesting Decision
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1304Problem DescriptionJudging a programming contest is hard work, with demanding contestants, tedious decisions, and monotonous work. Not to menti原创 2015-08-19 20:53:44 · 799 阅读 · 0 评论 -
HDU 5430 Reflect
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5430Problem DescriptionWe send a light from one point on a mirror material circle,it reflectsN times and return the original point firstly.Your原创 2015-09-10 10:37:12 · 436 阅读 · 0 评论 -
HDU 5310 Souvenir
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5310Problem DescriptionToday is the 1st anniversary of BestCoder. Soda, the contest manager, wants to buy a souvenir for each contestant. You can b原创 2015-09-10 11:48:46 · 424 阅读 · 0 评论 -
HDU 1050 Moving Tables
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1050Problem DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.原创 2015-09-10 09:54:11 · 365 阅读 · 0 评论 -
HDU 3177 Crixalis's Equipment
贪心题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3177Problem DescriptionCrixalis - Sand King used to be a giant scorpion(蝎子) in the deserts of Kalimdor. Though he's a guardian of Lich King now原创 2015-09-10 17:41:48 · 427 阅读 · 0 评论 -
HDU 2756 Unique Snowflakes
容器的使用题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2756Problem DescriptionEmily the entrepreneur has a cool business idea: packaging and selling snowflakes. She has devised a machine that cap原创 2015-09-10 23:59:28 · 871 阅读 · 0 评论 -
STL中的set容器的一点总结
原文出处:http://www.cnblogs.com/BeyondAnyTime/archive/2012/08/13/2636375.html1.关于setC++ STL 之所以得到广泛的赞誉,也被很多人使用,不只是提供了像vector, string, list等方便的容器,更重要的是STL封装了许多复杂的数据结构算法和大量常用数据结构操作。vector封装数组,list封装转载 2015-09-11 10:39:44 · 490 阅读 · 0 评论 -
HDU 2021
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2021Problem Description作为杭电的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口就靠它了,呵呵但是对于学校财务处的工作人员来说,这一天则是很忙碌的一天,财务处的小胡老师最近就在考虑一个问题:如果每个老师的工资额都知道,最少需要准备多少张人民币,原创 2015-08-18 11:48:05 · 443 阅读 · 0 评论 -
HDU 2031 进制转换
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2031Problem Description输入一个十进制数N,将它转换成R进制数输出。 Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(210)。 Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10原创 2015-08-18 12:31:38 · 367 阅读 · 0 评论 -
HDU 1042 大数阶乘
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file原创 2015-08-17 01:13:49 · 391 阅读 · 0 评论 -
HDU 2037 今年暑假不AC
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2037Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%...”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当原创 2015-08-17 01:03:43 · 364 阅读 · 0 评论 -
HDU 2032
Problem Description还记得中学时候学过的杨辉三角吗?具体的定义这里不再描述,你可以参考以下的图形:11 11 2 11 3 3 11 4 6 4 11 5 10 10 5 1 Input输入数据包含多个测试实例,每个测试实例的输入只包含一个正整数n(1 Output对应于每一个输入,请输出相应层数的杨辉三角,每一层的原创 2015-08-17 00:54:50 · 452 阅读 · 0 评论 -
HDU 1032 The 3n + 1 problem
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1032Problem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursi原创 2015-08-17 01:07:18 · 367 阅读 · 0 评论 -
HDU 2035 人见人爱A^B
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2035Problem Description求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方” Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1 Output对于每个测试实例,请输出A^B的最后三位表示的整原创 2015-08-18 12:06:56 · 610 阅读 · 0 评论 -
HDU 2010 水仙花数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2010Problem Description春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的:“水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3+5^3+3^3。现在要求输出所有在m和n范围内的水仙花数。原创 2015-08-18 12:10:00 · 914 阅读 · 0 评论 -
HDU 2097 Sky数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2097Problem DescriptionSky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=22,它的十六进制数BB0,其四位数字之和也为22,同时它的十二进制数表示1894,其四位原创 2015-08-18 11:55:07 · 365 阅读 · 0 评论 -
HDU 2018 母牛的故事
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2018Problem Description有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛? Input输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0n=0表示输入数据的原创 2015-08-18 11:58:30 · 440 阅读 · 0 评论 -
HDU 1013 Digital Roots
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1013Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single dig原创 2015-08-18 12:15:25 · 363 阅读 · 0 评论 -
HDU 2023 求平均成绩
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2023Problem Description假设一个班有n(n Input输入数据有多个测试实例,每个测试实例的第一行包括两个整数n和m,分别表示学生数和课程数。然后是n行数据,每行包括m个整数(即:考试分数)。 Output对于每个测试实例,输出3行原创 2015-08-18 12:18:58 · 497 阅读 · 0 评论 -
HDU 2091 空心三角形
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2091Problem Description把一个字符三角形掏空,就能节省材料成本,减轻重量,但关键是为了追求另一种视觉效果。在设计的过程中,需要给出各种花纹的材料和大小尺寸的三角形样板,通过电脑临时做出来,以便看看效果。 Input每行包含一个字符和一个整数n(0原创 2015-08-18 12:21:34 · 468 阅读 · 0 评论 -
搜索算法入门
本文将讨论一个简单的搜索算法:深度优先搜索DFSDFS的思想可以概括为:选择一个方向,一直往前走,直到无路可走。再回到有其他路可走的结点,重复上述步骤 ,直到回到出发点。实际上就是一个递归的思想。先来看一个递归求阶乘的例子。f(n)=n!,f(n)=n*f(n-1);...可以看成为从n开始,不断减1遍历,直到n变为1(递归结束点,也就是这条路已经无路可走了)。虽然这个例子只有一条原创 2016-02-18 18:02:01 · 645 阅读 · 0 评论