
最短路
YRZ-James
who say you are not perfect?
展开
-
A - 最短路
题目:在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是...原创 2019-02-01 16:52:56 · 815 阅读 · 0 评论 -
HDU - 1317 XYZZY
题目:It has recently been discovered how to run open-source software on the Y-Crate gaming device. A number of enterprising designers have developed Advent-style games for deployment on the Y-Crate. Yo...原创 2019-03-27 21:14:17 · 168 阅读 · 0 评论 -
HDU - 1874
某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。每组数据第一行包含两个正整数N和M(0<N<200,0<M&l...原创 2019-03-27 19:23:38 · 113 阅读 · 0 评论 -
HDU - 3790 最短路径问题
题目:给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。(1<n<=1000, 0<m...原创 2019-03-27 18:37:39 · 142 阅读 · 0 评论 -
HDU - 3339 In Action
题目:Since 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared across the globe.Nowadays,the crazy boy in FZU named AekdyC...原创 2019-03-31 14:08:08 · 135 阅读 · 0 评论 -
HDU - 2923 Einbahnstrasse
题目:Einbahnstra e (German for a one-way street) is a street on which vehicles should only move in one direction. One reason for having one-way streets is to facilitate a smoother flow of traffic thro...原创 2019-03-31 13:00:16 · 126 阅读 · 0 评论 -
HDU - 1548 A strange lift
题目:There 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 and down.When you at floor ...原创 2019-03-26 19:19:51 · 149 阅读 · 0 评论 -
HDU - 2680 Choose the best route
题目:One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s traffic route, a...原创 2019-03-29 21:09:45 · 127 阅读 · 0 评论 -
HDU - 1546 Idiomatic Phrases Game
题目:Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give Tom two idioms. He should build a list of idioms...原创 2019-03-29 20:21:59 · 249 阅读 · 0 评论 -
HDU - 1535 Invitation Cards
题目:In 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. T...原创 2019-03-29 19:01:00 · 147 阅读 · 0 评论 -
I - Currency Exchange
题目:Several 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...原创 2019-02-06 18:46:53 · 188 阅读 · 0 评论 -
H - Silver Cow Party
题目:One 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) unidirectional (one-way...原创 2019-02-03 12:16:11 · 206 阅读 · 0 评论 -
E - Til the Cows Come Home
题目:Bessie 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 wants to g...原创 2019-02-02 20:21:41 · 106 阅读 · 0 评论 -
D - Bus System
题目:ecause of the huge population of China, public transportation is very important. Bus is an important transportation method in traditional public transportation system. And it’s still playing an im...原创 2019-02-02 19:48:39 · 367 阅读 · 0 评论 -
C - HDU Today
题目:经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在什么地方下车(其实徐总自己有车,却一...原创 2019-02-02 14:06:41 · 225 阅读 · 0 评论 -
B - 一个人的旅行
题目:虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,0),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的放...原创 2019-02-01 21:37:00 · 264 阅读 · 0 评论 -
HihoCoder - 1081 最短路径·一
题目:描述万圣节的早上,小Hi和小Ho在经历了一个小时的争论后,终于决定了如何度过这样有意义的一天——他们决定去闯鬼屋!在鬼屋门口排上了若干小时的队伍之后,刚刚进入鬼屋的小Hi和小Ho都颇饥饿,于是他们决定利用进门前领到的地图,找到一条通往终点的最短路径。鬼屋中一共有N个地点,分别编号为1…N,这N个地点之间互相有一些道路连通,两个地点之间可能有多条道路连通,但是并不存在一条两端都是同一个...原创 2019-03-28 15:35:01 · 198 阅读 · 0 评论