
最短路
文章平均质量分 87
Nowara_Shinnosuke
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Subway
SubwayTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9933 Accepted: 3231DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, no原创 2017-05-30 10:32:38 · 347 阅读 · 0 评论 -
hdoj 6071 Lazy Running
题解:任取节点2较小邻边的两倍作为mod,若可以通过距离x再次到达节点2,则可以通过x+mod,x+2*mod,x+3*mod...再次到达节点2.所以利用同余,spfa()跑最短路求d[i][j](i代表从2节点到i节点,j代表从2节点到i节点的距离%mod==j,d[i][j]代表2节点到i节点距离%mod==j的最短距离)当再次回到2节点时,更新ans,最短距离小于k时,ans=mi原创 2017-08-05 09:25:10 · 316 阅读 · 0 评论 -
水群
总所周知,水群是一件很浪费时间的事,但是其实在水群这件事中,也可以找到一些有意思的东西。比如现在,bx2k就在研究怎样水表情的问题。首先,bx2k在对话框中输入了一个表情,接下来,他可以进行三种操作。第一种,是全选复制,把所有表情全选然后复制到剪贴板中。第二种,是粘贴,把剪贴板中的表情粘贴到对话框中。第三种,是退格,把对话框中的最后一个表情删去。假设原创 2017-07-24 10:15:49 · 2376 阅读 · 0 评论 -
Knapsack in a Globalized World
Problem descriptionGlobalization stops at nothing, not even at the good old honest profession of a burglar. Nowadays it is not enough to break in somewhere, take everything you can carry and dar原创 2017-08-01 10:11:48 · 600 阅读 · 0 评论 -
1444 破坏道路
1444 破坏道路题目来源: CodeForces基准时间限制:1.5 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注在某一个国家,那儿有n个城市,他们通过m条双向道路相连。城市从1到n编号。如果城市a和b通过一条道路直接相连,那么他们之间的距离就是一个小时。这个国家的道路网络可以允许你从任意一个原创 2017-07-23 11:45:10 · 628 阅读 · 1 评论 -
G - Domino Effect POJ - 1135
Did 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原创 2017-07-13 10:05:34 · 381 阅读 · 0 评论 -
E - Cycling HDU - 2363
You want to cycle to a programming contest. The shortest route to the contest might be over the tops of some mountains and through some valleys. From past experience you know that you perform badly in原创 2017-07-12 13:17:13 · 384 阅读 · 0 评论 -
路径和树
1443 路径和树题目来源: CodeForces基准时间限制:1.5 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 关注给定一幅无向带权连通图G = (V, E) (这里V是点集,E是边集)。从点u开始的最短路径树是这样一幅图G1 = (V, E1),其中E1是E的子集,并且在G1中,u到所有其它原创 2017-06-01 13:28:18 · 489 阅读 · 0 评论 -
Invitation Cards
Invitation CardsTime Limit: 8000MS Memory Limit: 262144KTotal Submissions: 27496 Accepted: 9147DescriptionIn the age of television, not many people attend theater原创 2017-05-29 23:20:19 · 325 阅读 · 0 评论 -
hdu 6181
题解:求次短路,先spfa跑一遍最短路,再依次删去最短路中的边找次短路,同时更新最短路顶点里最短的邻边,两种情况中取最小值。#include#include#include#include#includeusing namespace std;typedef long long ll;const ll inf=1e15+10;const int maxn=1e5+10;str原创 2017-08-25 11:14:59 · 443 阅读 · 0 评论