- 博客(161)
- 资源 (2)
- 收藏
- 关注
原创 食物链
Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说
2015-08-26 20:08:42
586
原创 Corporative Network
DescriptionA very big corporation is developing its corporative network. In the beginning each of the N enterprises of the corporation, numerated from 1 to N, organized its own computing and telecom
2015-08-26 11:31:42
755
原创 Wireless Network
DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all compu
2015-08-26 10:24:48
635
原创 Cube Stacking
DescriptionFarmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a single cube. Farmer John asks Betsy to p
2015-08-25 23:35:44
674
原创 The Suspects
DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best str
2015-08-25 21:20:18
340
原创 Blue Jeans
DescriptionThe Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was
2015-08-25 10:57:47
947
原创 Ancient Printer
Problem DescriptionThe contest is beginning! While preparing the contest, iSea wanted to print the teams' names separately on a single paper.Unfortunately, what iSea could find was only an ancient
2015-08-24 21:16:10
682
原创 Flying to the Mars
Problem DescriptionIn the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . Finally , PPF decides to attack Kscinow w
2015-08-24 16:43:38
607
原创 Intelligent IME
Problem Description We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific, the number buttons may correspond to some Engli
2015-08-24 13:05:21
1304
原创 Hat's Fibonacci
Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F(1) = 1, F(2) = 1, F(3) = 1,F(4) = 1, F(n>4) = F(n -
2015-08-24 11:08:26
603
原创 Hat’s Words
Problem DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are to find all the hat’s words in a dictionary. Inpu
2015-08-23 23:44:24
670
原创 hdu(2846)Repository
Problem DescriptionWhen you go shopping, you can search in repository for avalible merchandises by the computers and internet. First you give the search system a name about something, then the syste
2015-08-23 21:36:37
932
原创 Sorting It All Out
DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence
2015-08-21 23:34:49
610
原创 Slim Span
DescriptionGiven an undirected weighted graph G, you should find one of spanning trees specified as follows.The graph G is an ordered pair (V, E), where V is a set of vertices {v1,v2, …, vn} a
2015-08-21 22:01:21
1143
原创 The Unique MST
DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G i
2015-08-20 13:09:45
638
原创 Bad Cowtractors
DescriptionBessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found M
2015-08-20 12:04:44
505
原创 Out of Hay
DescriptionThe cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situation. There are N (2 <= N <= 2,000) farm
2015-08-20 11:15:56
352
原创 Network
DescriptionAndrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the company, they can be connected to each other using cables.
2015-08-20 10:58:57
642
原创 Borg Maze
DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg ci
2015-08-19 22:52:50
1156
原创 Big Christmas Tree
DescriptionChristmas is coming to KCM city. Suby the loyal civilian in KCM city is preparing a big neat Christmas tree. The simple structure of the tree is shown in right picture.The tree can be
2015-08-19 16:44:25
1357
原创 Cow Contest
DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skil
2015-08-19 10:48:13
517
原创 Cow Hurdles
DescriptionFarmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting tired, though, so they want to
2015-08-19 10:38:21
618
原创 Heavy Transportation
DescriptionBackground Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from t
2015-08-18 22:33:47
1098
原创 Skiing
DescriptionBessie and the rest of Farmer John's cows are taking a trip this winter to go skiing. One day Bessie finds herself at the top left corner of an R (1 <= R <= 100) by C (1 <= C <= 100) gr
2015-08-18 21:43:19
819
原创 Silver Cow Party
DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirec
2015-08-18 16:07:51
617
原创 Til the Cows Come Home
DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she
2015-08-18 15:28:14
453
原创 Tram
DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the
2015-08-18 14:43:33
1007
原创 Invitation Cards
DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique
2015-08-18 13:53:08
1221
转载 数组实现邻接表
【坐在马桶上看算法】算法8:巧妙的邻接表(数组实现)2014-04-08 15:52 ahalei 51CTO博客 我要评论(0) 字号:T | T细心的同学会发现,此时遍历边某个顶点边的时候的遍历顺序正好与读入时候的顺序相反。因为在为每个顶点插入边的时候都直接插入“链表”的首部而不是尾部。不过这并不会产生任何问题,这正是这种方法的其妙之处。AD:51CTO开启企业
2015-08-18 12:44:44
2901
1
原创 昂贵的聘礼
Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换
2015-08-16 12:13:36
613
原创 Wormholes
DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination a
2015-08-15 16:49:10
420
原创 Currency Exchange
DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currenci
2015-08-15 15:26:11
680
原创 Radar Installation
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, loc
2015-08-13 23:07:21
673
原创 Flip Game
DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying e
2015-08-13 17:25:01
695
原创 连连看
Problem Description“连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子。如果某两个相同的棋子,可以通过一条线连起来(这条线不能经过其它棋子),而且线的转折次数不超过两次,那么这两个棋子就可以在棋盘上消去。不好意思,由于我以前没有玩过连连看,咨询了同学的意见,连线不能从外面绕过去的,但事实上这是错的。现在已经酿成大祸,就只能将
2015-08-11 19:48:39
586
原创 What Are You Talking About
Problem DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leave
2015-08-11 17:15:37
394
原创 Nightmare
Problem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb e
2015-08-11 16:36:27
396
原创 Prime Ring Problem
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.
2015-08-11 15:26:41
356
原创 Ignatius and the Princess I
Problem DescriptionThe Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth.
2015-08-11 11:18:51
353
转载 ACM学习指南
正在学(learning),未学(waiting),已学(cut vovering) 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (
2015-08-10 22:04:22
805
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅