06 2015 档案
摘要:
A 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 set of n squares on a chessboard exactly once. He thinks that the most difficult part of the problem is determining the smallest number of knight moves between two given squares and that, once you have accomplished this, finding the tour
阅读全文
A 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 set of n squares on a chessboard exactly once. He thinks that the most difficult part of the problem is determining the smallest number of knight moves between two given squares and that, once you have accomplished this, finding the tour
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2645find the nearest stationDescriptionSince dandelion has left the hometown so long,she finds it's diff...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2425Hiking TripDescriptionHiking in the mountains is seldom an easy task for most people, as it is extre...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1973Prime PathDescriptionThe ministers of the cabinet were quite upset by the message from the Chief of ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5146SequenceDescriptionToday we have a number sequence A includes n elements.Nero thinks a number sequen...
阅读全文
摘要:
某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?
Input
测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正整数,分别是该条道路直接连通的两个城镇的编号。为简单起见,城镇从1到N编号。
注意:两个城市之间可以有多条道路相通,也就是说
阅读全文
某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?
Input
测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正整数,分别是该条道路直接连通的两个城镇的编号。为简单起见,城镇从1到N编号。
注意:两个城市之间可以有多条道路相通,也就是说
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1213How Many TablesDescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2822DogsDescriptionPrairie dog comes again! Someday one little prairie dog Tim wants to visit one of his...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1242RescueDescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is des...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5101SelectDescriptionOne day, Dudu, the most clever boy, heard of ACM/ICPC, which is a very interesting ...
阅读全文
摘要:
看病要排队这个是地球人都知道的常识。
不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话,则选择最早来排队的病人。
现在就请你帮助医院模拟这个看病过程。
阅读全文
看病要排队这个是地球人都知道的常识。
不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话,则选择最早来排队的病人。
现在就请你帮助医院模拟这个看病过程。
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5112A Curious MattDescriptionThere is a curious man called Matt.One day, Matt's best friend Ted is wande...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5154Harry and Magical ComputerDescriptionIn reward of being yearly outstanding magic student, Harry gets...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1548A strange liftDescriptionThere is a strange lift.The lift can stop can at every floor as you want, a...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1872稳定排序Description大家都知道,快速排序是不稳定的排序方法。如果对于数组中出现的任意a[i],a[j](i_ 2 #include 3 #include 4 #include 5 #incl...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2579Dating with girls(2)DescriptionIf you have solved the problem Dating with girls(1).I think you can s...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2578Dating with girls(1)DescriptionEveryone in the HDU knows that the number of boys is larger than the ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1541StarsDescriptionAstronomers often examine star maps where stars are represented by points on a plane...
阅读全文
摘要:
Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the system will add a message to the queue. Meanwhile, the process will do a loop for getting message from the queue according to the priority value if it is not empty. Note that the less priority value means the higher pr
阅读全文
Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the system will add a message to the queue. Meanwhile, the process will do a loop for getting message from the queue according to the priority value if it is not empty. Note that the less priority value means the higher pr
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1228A + BDescription读入两个小于100的正整数A和B,计算A+B.需要注意的是:A和B的每一位数字由对应的英文单词给出.Input测试输入包含若干测试用例,每个测试用例占一行,格式为"A ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1196Lowest BitDescriptionGiven an positive integer $A (1 \leq A \leq 100)$, output the lowest bit of $A....
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3530SubsequenceDescriptionThere is a sequence of integers. Your task is to find the longest subsequence ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2098分拆素数和Description把一个偶数拆成两个不同素数的和,有几种拆法呢?Input输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。Output对应每个偶数,输出...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5273Dylans loves sequenceDescriptionDylans is given $N$ numbers $a[1]....a[N]$And there are $Q$ question...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5272Dylans loves numbersDescriptionWho is Dylans?You can find his ID in UOJ and Codeforces.His another I...
阅读全文
摘要:
ACboy was kidnapped!!
he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(.
As a smart ACMer, you want to get ACboy out of the monster's labyrinth.But when you arrive at the gate of the maze, the monste say :" I have heard that you are very clever, but if can't solve my problems, you will die with ACboy."
The problems of the monster is sho
阅读全文
ACboy was kidnapped!!
he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(.
As a smart ACMer, you want to get ACboy out of the monster's labyrinth.But when you arrive at the gate of the maze, the monste say :" I have heard that you are very clever, but if can't solve my problems, you will die with ACboy."
The problems of the monster is sho
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3282{A} + {B}Description给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字$n,m(0 2 #include...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3282Running MedianDescriptionFor this problem, you will write a program that reads in a sequence of 32-b...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1316How Many Fibs?DescriptionRecall the definition of the Fibonacci numbers: $f_1 := 1$ $f_2 := 2$ $f_n ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1715大菲波数Description$Fibonacci$数列,定义如下:$f(1)=f(2)=1$$f(n)=f(n-1)+f(n-2) \ \ 3 \leq n$。计算第$n$项$Fibonacci$数...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1212Train Problem IIDescriptionAs we all know the Train Problem I, the boss of the Ignatius Train Statio...
阅读全文
摘要:
As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice some other item in the same list. You will need a program to help you with the grading. This program should be able to scan the lists and output the correct answer for each one. For example, given th
阅读全文
As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice some other item in the same list. You will need a program to help you with the grading. This program should be able to scan the lists and output the correct answer for each one. For example, given th
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1212Big NumberDescriptionAs we know, Big Number is always troublesome. But it's really important in our ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1250Hat's FibonacciDescriptionA Fibonacci sequence is calculated by adding the previous two members the ...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2203亲和串Description人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3999The order of a TreeDescriptionAs we know,the shape of a binary search tree is greatly related to the...
阅读全文
摘要:题目连接http://poj.org/problem?id=2299Ultra-QuickSortDescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm process...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1908Double QueueDescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office i...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1556Color the ballDescription$N$个气球排成一排,从左到右依次编号为$1,2,3....N.$每次给定2个整数$a\ b(a \leq b)$,lele便为骑上他的“小飞鸽"牌电...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4288CoderDescriptionIn mathematics and computer science, an algorithm describes a set of procedures or i...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5265pog loves szh IIDescriptionPog and Szh are playing games.There is a sequence with n numbers, Pog wil...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5058So easyDescriptionSmall W gets two files. There are n integers in each file. Small W wants to know w...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2091空心三角形Description把一个字符三角形掏空,就能节省材料成本,减轻重量,但关键是为了追求另一种视觉效果。在设计的过程中,需要给出各种花纹的材料和大小尺寸的三角形样板,通过电脑临时做出来,以便...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5142NPY and FFTDescriptionA boy named NPY is learning FFT algorithm now.In that algorithm,he needs to do...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5264pog loves szh IDescriptionPog has lots of strings. And he always mixes two equal-length strings. For...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1277全文检索Description我们大家经常用google检索信息,但是检索信息的程序是很困难编写的;现在请你编写一个简单的全文检索程序。问题的描述是这样的:给定一个信息流文件,信息完全有数字组成,数字...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1698Just a HookDescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for...
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1029Ignatius and the Princess IVDescriptionOK, you are not too bad, em... But you can never pass the nex...
阅读全文
摘要:题目连接http://poj.org/problem?id=3061SubsequenceDescriptionA sequence of N positive integers (10 2 #include 3 #include 4 #include 5 #include 6 using std...
阅读全文

浙公网安备 33010602011771号