
最短路
文章平均质量分 68
TLECODE
这个作者很懒,什么都没留下…
展开
-
【hdu 2066】 一个人的旅行
Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时原创 2017-11-07 20:12:48 · 304 阅读 · 0 评论 -
【bzoj 4152】 The Captain 【AMPPZ2014】
Description给定平面上的n个点,定义(x1,y1)到(x2,y2)的费用为min(|x1-x2|,|y1-y2|),求从1号点走到n号点的最小费用。 Input第一行包含一个正整数n(2<=n<=200000),表示点数。接下来n行,每行包含两个整数x[i],y[i](0<=x[i],y[i]<=10^9),依次表示每个点的坐标。 Ou...原创 2018-08-14 16:16:29 · 263 阅读 · 0 评论 -
【bzoj 4773】 负环
Description在忘记考虑负环之后,黎瑟的算法又出错了。对于边带权的有向图 G = (V, E),请找出一个点数最小的环,使得环上的边权和为负数。保证图中不包含重边和自环。 Input第1两个整数n, m,表示图的点数和边数。接下来的m行,每<=三个整数ui, vi, wi,表<=有一条从ui到vi,权值为wi的有向边。2 <= n <= ...原创 2018-08-04 23:12:32 · 476 阅读 · 0 评论 -
【bzoj 1726】 Roadblocks第二短路 【Usaco2006 Nov】
Description贝茜把家搬到了一个小农场,但她常常回到FJ的农场去拜访她的朋友。贝茜很喜欢路边的风景,不想那么快地结束她的旅途,于是她每次回农场,都会选择第二短的路径,而不象我们所习惯的那样,选择最短路。 贝茜所在的乡村有R(1<=R<=100,000)条双向道路,每条路都联结了所有的N(1<=N<=5000)个农场中的某两个。贝茜居住在农场1,她的朋友们居住在农...原创 2018-08-03 16:25:40 · 403 阅读 · 0 评论 -
【bzoj 1027】 合金 【JSOI2007】
Description 某公司加工一种由铁、铝、锡组成的合金。他们的工作很简单。首先进口一些铁铝锡合金原材料,不同种类的原材料中铁铝锡的比重不同。然后,将每种原材料取出一定量,经过融解、混合,得到新的合金。新的合金的铁铝锡比重为用户所需要的比重。 现在,用户给出了n种他们需要的合金,以及每种合金中铁铝锡的比重。公司希望能够订购最少种类的原材料,并且使用这些原材料可以加工出用户需要的所有...原创 2018-07-26 09:15:37 · 189 阅读 · 0 评论 -
【bzoj 1001】 狼抓兔子 [BeiJing2006]
Description现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的,而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(N,M)(上图中N=4,M=5).有以下三种类型的道路 1:(x,y)(x+1,y) 2:(x,y)(x,y+1) 3:(x,y)(x+1,y原创 2017-12-02 22:14:47 · 294 阅读 · 0 评论 -
【bzoj 1003】 物流运输 【ZJOI2006】
Description 物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转停好几个码头。物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪。由于各种因素的存在,有的时候某个码头会无法装卸货物。这时候就必须修改运输路线,让货物能够按时到达目的地。但是修改路线是一件十分麻烦的事情,会带来额外的成本。因此物流原创 2017-12-06 22:03:17 · 621 阅读 · 0 评论 -
【poj3259】Wormholes 【USACO 2006 December Gold】
DescriptionWhile exploring his many farms, Farmer John hasdiscovered a number of amazing wormholes. A wormhole is very peculiar becauseit is a one-way path that delivers you to its destination at a原创 2017-06-28 20:33:13 · 696 阅读 · 0 评论 -
【poj 1125】Stockbroker Grapevine
DescriptionStockbrokers 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原创 2017-07-05 21:17:48 · 339 阅读 · 0 评论 -
【poj2387】Til the Cows Come Home 【USACO 2004 November】
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 w原创 2017-08-02 22:30:48 · 553 阅读 · 0 评论 -
【poj 3268】 Silver Cow Party 【USACO 2007 February Silver】
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) unidirect原创 2017-10-10 14:58:02 · 338 阅读 · 0 评论 -
【poj 1511】 Invitation Cards 【Central Europe 1998】
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原创 2017-10-16 16:18:31 · 327 阅读 · 0 评论 -
【poj 1502】 MPI Maelstrom 【East Central North America 1996】
DescriptionBIT 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原创 2017-11-05 20:44:56 · 319 阅读 · 0 评论 -
【bzoj 1202】 狡猾的商人 【HNOI2005】
Description刁姹接到一个任务,为税务部门调查一位商人的账本,看看账本是不是伪造的。账本上记录了n个月以来的收入情况,其中第i 个月的收入额为Ai(i=1,2,3...n-1,n), 。当 Ai大于0时表示这个月盈利Ai 元,当 Ai小于0时表示这个月亏损Ai 元。所谓一段时间内的总收入,就是这段时间内每个月的收入额的总和。 刁姹的任务是秘密进行的,为了调查商人的账本,她只好跑到商人那...原创 2018-08-21 18:20:22 · 226 阅读 · 0 评论