自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 收藏
  • 关注

原创 acm课题总结

学了近一学期的acm,从开始什么都不懂到逐渐懂得用算法解决问题,从不顾时间性能和空间性能到开始考虑怎样减少时间复杂度和空间复杂度问题,正如老师所说的‘你选这门课,收获的不仅是学分,更重要的是你会发现你的思想,考虑问题的角度都会得到提升’。从一开始学的贪心算法到搜索再到动态规划,最后是图论。每一种算法都会收获不一样的感悟,贪心算法顾名思义贪心,每次选最短的时间或其他 ;搜索么就是遍历,分为广度和

2016-07-07 07:54:22 653 1

原创 acm_Bus systemt

题目:Problem DescriptionBecause of the huge population of China, public transportation is very important. Bus is an important transportation method in traditional public transportation system.

2016-06-28 21:41:51 548

原创 acm_pictures

题目:Problem DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newes

2016-06-27 20:28:31 342

原创 acm_city

题目:Problem DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle over

2016-06-24 11:25:06 318

原创 acm_Constructing Roads

题目:Problem DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B

2016-06-23 20:36:49 293

原创 acm_畅通工程3

题目:Problem ETime Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 85   Accepted Submission(s) : 27Problem Description省政府“畅通工程”的目标是

2016-06-21 17:17:19 435

原创 acm_畅通工程2

题目:Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目

2016-06-21 12:48:51 337

原创 acm_畅通工程

题目:Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?  Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别

2016-06-19 10:51:41 834

原创 acm_最短路

题目:Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、M(N输入保证至少存在1条商店到赛场的路线

2016-06-18 19:41:55 324

原创 dp总结

首先动态规划是解决多阶段决策问题的一种方法。。     动态规划本质上就是一种排除重复计算的算法,更具体的说,动态规划就是用空间换取时间。      多阶段决策问题:如果一类问题的求解过程可以分为若干个互相联系的阶段,在每一个阶段都需作出决策,并影响到下一个阶段的决策。多阶段决策问题,就是要在可以选择的那些策略中间,选取一个最优策略,使在预定的标准下达到最好的效果.

2016-05-31 20:44:12 222

原创 acm_Humble Numbers

题目:Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... show

2016-05-31 19:50:36 237

原创 acm_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 introdu

2016-05-30 11:10:18 252

原创 acm_接馅饼

题目:Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩

2016-05-28 21:03:19 364

原创 acm_猴子与箱子

题目:Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monk

2016-05-27 15:23:14 339

原创 acm_录取概率

题目:Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Spe

2016-05-26 20:56:49 917

原创 acm_幸运大迷宫

题目:Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧!命运大迷宫可以看成是一个两维的方

2016-05-23 09:47:50 350

原创 acm_蜂巢

题目:Problem Description有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。 Input输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0 Output对于每个测试实例,请输出蜜蜂从

2016-05-22 23:17:45 509

原创 acm_骨牌铺方格

题目:Problem Description在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数.例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: Input输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2×n (0 Output对于每个测试实例,请

2016-05-21 14:14:17 464

原创 acm_方格移动

题目:Problem Description在一无限大的二维平面中,我们做如下假设:1、  每次只能移动一格;2、  不能向后走(假设你的目的地是“向上”,那么你可以向左走,可以向右走,也可以向上走,但是不可以向下走);3、  走过的格子立即塌陷无法再走第二次;求走n步不同的方案数(2种走法只要有一步不一样,即被认为是

2016-05-19 21:35:43 1643

原创 acm_Proud Merchants

题目:Problem DescriptionRecently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are

2016-05-18 20:32:04 255

原创 acm_小母牛问题

题目:Problem Description有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛? Input输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0n=0表示输入数据的结束,不做处理。 Output对于每个测试实例,输出在第n年的时候母牛的数量。每个输

2016-05-12 20:37:03 715

原创 acm_楼梯走法

题目:Problem Description有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法? Input输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1 Output对于每个测试实例,请输出不同走法的数量 Sample Input223 

2016-05-12 20:34:49 1859

原创 acm_数塔问题

题目:Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1  Out

2016-05-11 20:34:07 488

原创 acm_十进制转二进制

题目:Problem DescriptionGive you a number on base ten,you should output it on base two.(0 < n < 1000) InputFor each case there is a postive number n on base ten, end of file. O

2016-05-10 20:52:06 1270

原创 acm_最大折线分割平面数目

题目:Problem Description我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。 Input输入数据的第一行是一个整数C,表示测试实例的个数,然后是C 行数据,每行包含一个整数n(0 Output对于每个测

2016-05-09 21:10:43 1264

原创 acm_最长相同子序列

题目:Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z

2016-05-08 17:53:16 362

原创 acm_最长子序列

题目: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

2016-05-07 23:29:01 579

原创 acm_Sequence one

题目:Problem DescriptionSearch is important in the acm algorithm. When you want to solve a problem by using the search method, try to cut is very important.Now give you a number sequence, include

2016-04-24 23:37:14 274

原创 acm_Toxophily

题目:Problem DescriptionThe recreation center of WHU ACM Team has indoor billiards, Ping Pang, chess and bridge, toxophily, deluxe ballrooms KTV rooms, fishing, climbing, and so on.We all like tox

2016-04-24 21:43:14 180

原创 acm_A strange lift

题目:Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up a

2016-04-24 21:33:15 271

原创 acm_Knight Moves

题目:Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given se

2016-04-24 21:26:17 215

原创 acm_非常可乐

题目:Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互

2016-04-24 21:16:01 1672

原创 acm_猜数字

题目:Problem DescriptionA有1数m,B来猜.B每猜一次,A就说"太大","太小"或"对了" 。 问B猜n次可以猜到的最大数。  Input第1行是整数T,表示有T组数据,下面有T行 每行一个整数n (1 ≤ n ≤ 30)  Output猜n次可以猜到的最大数 S

2016-04-23 13:50:29 880

原创 acm_1003_pie

题目:Problem DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are com

2016-04-23 13:00:03 236

原创 acm_1002_Strange fuction

题目描述:Problem DescriptionNow, here is a fuction:  F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 100. InputThe f

2016-04-21 20:15:10 213

原创 acm_专题2_1001

题目描述:Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky. InputThe first line of the input

2016-04-21 19:59:25 234

原创 acm_贪心总结

贪心算法:在求最优解问题的过程中,依据某种贪心标准,从问题的初始状态出发,直接去求每一步的最优解,通过若干次的贪心选择,最终得出整个问题的最优解,这种求解方法就是贪心算法。从贪心算法的定义可以看出,贪心算法不是从整体上考虑问题,它所做出的选择只是在某种意义上的局部最优解,而由问题自身的特性决定了该题运用贪心算法可以得到最优解。而且如果一个问题可以有多个方法求解,那么贪心算法一定是最好的解决

2016-04-03 00:14:17 1599

原创 acm_problem_1016

题目描述: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

2016-04-01 23:49:07 287

原创 accm_problem_1014

题目描述:Problem DescriptionBefore bridges were common, ferries were used to transport cars across rivers. River ferries, unlike their larger cousins, run on a guide line and are powered by the rive

2016-04-01 13:31:21 252

原创 acm_problem_1013

题目描述:Problem DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.All what they remember is that

2016-04-01 13:18:33 294

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除