![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HDU
文章平均质量分 58
Mr_rainxbow
上学中。码农养成中。java和web修炼中。
展开
-
[暖手][学习阶段-各路杂题][HDU-1005]Number Sequence
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).原创 2015-01-27 23:15:03 · 405 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1157]Who's in the Middle
Problem DescriptionFJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives: half of the cows give as much or more than the median; half give a原创 2015-01-31 23:32:43 · 454 阅读 · 0 评论 -
[汉诺塔][第二阶段-汉诺塔入门][HDOJ-2175]汉诺塔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次移动的是那一个盘子.原创 2015-01-13 13:19:22 · 790 阅读 · 0 评论 -
[math][第二阶段-easy math][HDU-2138]How many prime numbers
Problem Description Give you a lot of positive integers, just to find out how many prime numbers there are. Input There are a lot of cases. In each case, there is an integer N representi原创 2015-01-13 22:15:40 · 267 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1163]Eddy's digital Roots
Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the result原创 2015-02-01 00:27:26 · 402 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1202]The calculation of GPA
Problem Description每学期的期末,大家都会忙于计算自己的平均成绩,这个成绩对于评奖学金是直接有关的。国外大学都是计算GPA(grade point average) 又称GPR(grade point ratio),即成绩点数与学分的加权平均值来代表一个学生的成绩的。那么如何来计算GPA呢? 一般大学采用之计分法 A90 - 100 4 点 B80 -原创 2015-02-02 12:02:58 · 392 阅读 · 0 评论 -
[math][第二阶段-easy math][HDU-1722]Cake
Problem Description一次生日Party可能有p人或者q人参加,现准备有一个大蛋糕.问最少要将蛋糕切成多少块(每块大小不一定相等),才能使p人或者q人出席的任何一种情况,都能平均将蛋糕分食. Input每行有两个数p和q. Output输出最少要将蛋糕切成多少块. Sample Inp原创 2015-01-13 23:54:42 · 373 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1205]吃糖果(回去就买组合数学 不买剁手)
想了半天 感觉长的好像鸽巢 但是还是用了很笨的办法A的。离散和组合数学还真是需要自学一下。Problem DescriptionHOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序原创 2015-02-02 16:17:11 · 355 阅读 · 0 评论 -
[math][第二阶段-easy math][HDU-2136]Largest prime factor
Problem DescriptionEverybody knows any number can be combined by the prime number.Now, your task is telling me what position of the largest prime factor.The position of prime 2 is 1, prime 3 i原创 2015-01-14 00:59:24 · 323 阅读 · 0 评论 -
[math][第二阶段-easy math][HDU-2504]又见GCD
Problem Description有三个正整数a,b,c(0 Input第一行输入一个n,表示有n组测试数据,接下来的n行,每行输入两个正整数a,b。 Output输出对应的c,每组测试数据占一行。 Sample Input26 212 4 Sample Outp原创 2015-01-14 16:05:49 · 377 阅读 · 0 评论 -
[背包问题][第三阶段-初见dp][HDU-1087]Super Jumping! Jumping! Jumping!
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to原创 2015-01-15 23:33:21 · 376 阅读 · 0 评论 -
[背包问题][第三阶段-初见dp][HDU-2504]Bone Collector
Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grav原创 2015-01-15 18:29:53 · 477 阅读 · 0 评论 -
HDU-1266 Reverse Number
题目链接:点我点我点我其实这题没啥难度,简单的字符串处理,开学考java练练手而已只需要注意0 负数 还有 末尾有0的数字就好另外,书写风格还是太差了。代码如下:import java.util.Arrays;import java.util.Scanner;public class Main { public原创 2015-02-20 16:38:47 · 625 阅读 · 0 评论 -
HDU-1279 验证角谷猜想
题目链接:点我点我点我原本以为第一遍会TLE的,虽然复杂度是O(N)结果发现是自己想多了。注意0 1输入,屁股别加空格就好了Problem Description数论中有许多猜想尚未解决,其中有一个被称为“角谷猜想”的问题,该问题在五、六十年代的美国多个著名高校中曾风行一时,这个问题是这样描述的:任何一个大于一的自然数,如果是奇数,则原创 2015-02-24 11:28:29 · 862 阅读 · 0 评论 -
[背包问题][第三阶段-初见dp][HDU-1003]Max Sum
Problem DescriptionGiven 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-01-25 23:52:41 · 423 阅读 · 0 评论 -
[背包问题][第三阶段-初见dp][HDU-1203]I NEED A OFFER!
Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了原创 2015-01-25 13:39:18 · 448 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1235]统计同成绩学生人数
Problem Description读入N名学生的成绩,将获得某一给定分数的学生人数输出。 Input测试输入包含若干测试用例,每个测试用例的格式为第1行:N第2行:N名学生的成绩,相邻两数字用一个空格间隔。第3行:给定分数当读到N=0时输入结束。其中N不超过1000,成绩分数为(包含)0到100之间的一个整数。原创 2015-01-31 00:59:54 · 515 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1164]Eddy's research I
Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't w原创 2015-02-01 01:07:28 · 427 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1008]Elevator
Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specifie原创 2015-01-28 00:30:31 · 468 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1002]A + B Problem II
这种大数题 用java简直和开挂一样Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the i原创 2015-01-27 23:43:01 · 434 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1012]u Calculate e
Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.原创 2015-01-28 11:04:06 · 407 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1017]A Mathematical Curiosity
Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you ar原创 2015-01-28 16:53:05 · 400 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1028]Ignatius and the Princess III
Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define a原创 2015-01-29 21:14:39 · 411 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1021]Fibonacci Again
Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). InputInput consists of a sequence of lines, each containing an i原创 2015-01-28 22:25:24 · 330 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1030]Delta-wave
Problem DescriptionA triangle field is numbered with successive integers in the way shown on the picture below. The traveller needs to go from the cell with number M to the cell with num原创 2015-01-29 10:05:41 · 436 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1860]统计字符
Problem Description统计一个给定字符串中指定的字符出现的次数 Input测试输入包含若干测试用例,每个测试用例包含2行,第1行为一个长度不超过5的字符串,第2行为一个长度不超过80的字符串。注意这里的字符串包含空格,即空格也可能是要求被统计的字符之一。当读到'#'时输入结束,相应的结果不要输出。 Output对每原创 2015-01-29 22:22:41 · 441 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1018]Big Number
Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you ar原创 2015-01-28 19:12:17 · 397 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1020]Encoding
Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k same characters should be encoded to "kX" where "X"原创 2015-01-28 22:13:18 · 317 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1859]最小长方形
Problem Description给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内。长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内。 Input测试输入包含若干测试用例,每个测试用例由一系列坐标组成,每对坐标占一行,其中|x|和|y|小于 231;一对0 坐标标志着一个测试用例的结束。注意(0,原创 2015-01-29 22:02:18 · 444 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1406]完数
Problem Description完数的定义:如果一个大于1的正整数的所有因子之和等于它的本身,则称这个数是完数,比如6,28都是完数:6=1+2+3;28=1+2+4+7+14。本题的任务是判断两个正整数之间完数的个数。 Input输入数据包含多行,第一行是一个正整数n,表示测试实例的个数,然后就是n个测试实例,每个实例占一行,由两个正整数nu原创 2015-01-29 22:48:03 · 465 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1164]Beat the Spread!
Problem DescriptionSuperbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on th原创 2015-02-01 11:32:19 · 475 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1106]排序
Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 Input输入包含多组测试用例,每组输原创 2015-01-31 10:17:49 · 416 阅读 · 0 评论 -
[math][第二阶段-easy math][HDU-1108]最小公倍数
Problem Description给定两个正整数,计算这两个数的最小公倍数。 Input输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数. Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。 Sample Input10 14 Sample Output原创 2015-01-13 14:07:14 · 668 阅读 · 0 评论 -
[暖手][学习阶段-各路杂题][HDU-1070]Milk
Problem DescriptionIgnatius drinks milk everyday, now he is in the supermarket and he wants to choose a bottle of milk. There are many kinds of milk in the supermarket, so Ignatius wants to know w原创 2015-01-31 22:58:47 · 491 阅读 · 0 评论 -
HDU-1282 回文数猜想
题目链接:点击打开链接题目倒是不难,只是简单的字符串处理只不过要先输出转换次数,再输出过程,就需要记录整个过程用java写的但是却一股C的味道。Problem Description一个正整数,如果从左向右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数。任取一个正整数,如果不是回文数,将该数与他的倒序数相加,若其和不是回文原创 2015-03-07 21:35:34 · 612 阅读 · 0 评论