随笔分类 -  最短路径

摘要:1, HDU 1548A strange lift :http://acm.hdu.edu.cn/showproblem.php?pid=1548这道题可以灰常巧妙的转换为一道最短路题目,对第i层,按钮数字为button[i],则如果满足相加=1,则把i到i-button[i]的路径长度设为1.则最后输出终点的最短路的长度即可#include#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;int n,a,b;int map[210][210],vis[210],dis[210];int SPFA(){ . 阅读全文
posted @ 2013-07-01 09:05 Jack Ge 阅读(274) 评论(0) 推荐(0) 编辑
摘要:Cow RelaysTime Limit:1000MSMemory Limit:65536KTotal Submissions:4395Accepted:1748DescriptionFor their physical fitness program,N(2 ≤N≤ 1,000,000) cows have decided to run a relay race using theT(2 ≤T≤ 100) cow trails throughout the pasture.Each trail connects two different intersections (1 ≤I1i≤ 1,0 阅读全文
posted @ 2013-05-11 09:25 Jack Ge 阅读(499) 评论(0) 推荐(0) 编辑
摘要:As long as Binbin loves SangsangTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1601Accepted Submission(s): 429Problem DescriptionBinbin misses Sangsang so much. He wants to meet with Sangsang as soon as possible.Now Binbin downloads a map from ELG 阅读全文
posted @ 2013-05-09 15:14 Jack Ge 阅读(247) 评论(0) 推荐(0) 编辑
摘要:Invitation CardsTime Limit:8000MSMemory Limit:262144KTotal Submissions:15889Accepted:5159DescriptionIn 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 Comedies. They 阅读全文
posted @ 2013-05-03 16:33 Jack Ge 阅读(216) 评论(0) 推荐(0) 编辑
摘要:RoadblocksTime Limit:2000MSMemory Limit:65536KTotal Submissions:5256Accepted:2013DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the way. She has dec 阅读全文
posted @ 2013-05-01 23:11 Jack Ge 阅读(375) 评论(0) 推荐(0) 编辑
摘要:Big Christmas TreeTime Limit:3000MSMemory Limit:131072KTotal Submissions:18303Accepted:3881DescriptionChristmas 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 represented as 阅读全文
posted @ 2013-05-01 18:22 Jack Ge 阅读(472) 评论(0) 推荐(0) 编辑
摘要:SightseeingTime Limit:2000MSMemory Limit:65536KTotal Submissions:6240Accepted:2197DescriptionTour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one citySto another cityF. On this way, the tourists in the bus can see the sights alongside th 阅读全文
posted @ 2013-04-29 22:28 Jack Ge 阅读(3760) 评论(0) 推荐(1) 编辑
摘要:Checking an AlibiTime Limit:1000MSMemory Limit:65536KTotal Submissions:5685Accepted:2060DescriptionA crime has been comitted: a load of grain has been taken from the barn by one of FJ's cows. FJ is trying to determine which of his C (1 #include#include#includeusing namespace std;const int VM=520 阅读全文
posted @ 2013-04-29 21:43 Jack Ge 阅读(333) 评论(0) 推荐(0) 编辑
摘要:Currency ExchangeTime Limit:1000MSMemory Limit:30000KTotal Submissions:15324Accepted:5275DescriptionSeveral 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 currencies. There can 阅读全文
posted @ 2013-04-23 18:44 Jack Ge 阅读(559) 评论(0) 推荐(0) 编辑
摘要:WormholesTime Limit:2000MSMemory Limit:65536KTotal Submissions:23270Accepted:8301DescriptionWhile 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 at a time that is BEFORE 阅读全文
posted @ 2013-04-23 18:18 Jack Ge 阅读(2515) 评论(2) 推荐(0) 编辑
摘要:Median Weight BeadTime Limit:1000MSMemory Limit:30000KTotal Submissions:2494Accepted:1249DescriptionThere are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your task is to find the bead whose weight is median (the 阅读全文
posted @ 2013-04-23 17:43 Jack Ge 阅读(554) 评论(0) 推荐(0) 编辑
摘要:ArbitrageTime Limit:1000MSMemory Limit:65536KTotal Submissions:12287Accepted:5168DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British pound, 阅读全文
posted @ 2013-04-23 15:35 Jack Ge 阅读(132) 评论(0) 推荐(0) 编辑
摘要:FroggerTime Limit:1000MSMemory Limit:65536KTotal Submissions:19928Accepted:6464DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sunscreen 阅读全文
posted @ 2013-04-23 15:19 Jack Ge 阅读(239) 评论(0) 推荐(0) 编辑
摘要:106 miles to ChicagoTime Limit:2000MSMemory Limit:65536KTotal Submissions:3305Accepted:1557Special JudgeDescriptionIn the movie "Blues Brothers", the orphanage where Elwood and Jack were raised may be sold to the Board of Education if they do not pay 5000 dollars in taxes at the Cook Count 阅读全文
posted @ 2013-04-23 14:41 Jack Ge 阅读(490) 评论(0) 推荐(0) 编辑
摘要:MPI MaelstromTime Limit:1000MSMemory Limit:10000KTotal Submissions:3896Accepted:2330DescriptionBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advis 阅读全文
posted @ 2013-04-23 14:15 Jack Ge 阅读(237) 评论(0) 推荐(0) 编辑
摘要:Remmarguts' DateTime Limit:4000MSMemory Limit:65536KTotal Submissions:17098Accepted:4696Description"Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story."Prince Remmarguts lives i 阅读全文
posted @ 2013-04-16 19:55 Jack Ge 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Part AcquisitionTime Limit:1000MSMemory Limit:65536KTotal Submissions:2909Accepted:1262Special JudgeDescriptionThe cows have been sent on a mission through space to acquire a new milking machine for their barn. They are flying through a cluster of stars containing N (1 <= N <= 50,000) planets, 阅读全文
posted @ 2013-04-14 09:12 Jack Ge 阅读(389) 评论(0) 推荐(0) 编辑
摘要:WallsTime Limit:1000MSMemory Limit:10000KTotal Submissions:7166Accepted:3533DescriptionIn a country, great walls have been built in such a way that every great wall connects exactly two towns. The great walls do not cross each other. Thus, the country is divided into such regions that to move from o 阅读全文
posted @ 2013-04-12 16:32 Jack Ge 阅读(332) 评论(0) 推荐(0) 编辑
摘要:Domino EffectTime Limit:1000MSMemory Limit:65536KTotal Submissions:6486Accepted:1641DescriptionDid you know that you can use domino bones for other things besides playing Dominoes? Take a number of dominoes and build a row by standing them on end with only a small distance in between. If you do it r 阅读全文
posted @ 2013-04-12 14:14 Jack Ge 阅读(577) 评论(0) 推荐(0) 编辑
摘要:Stockbroker GrapevineTime Limit:1000MSMemory Limit:10000KTotal Submissions:22649Accepted:12348DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the st 阅读全文
posted @ 2013-04-12 13:49 Jack Ge 阅读(341) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示