摘要: 题意 给定一张图,计算从1到各点的最短距离+各点到1的最短距离。spfa即可,分别正向,反向建一个图。水~View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<queue> 5 #include<algorithm> 6 using namespace std; 7 const int maxn = 1000005; 8 const int maxm = 1000015; 9 const int inf = 99999999 阅读全文
posted @ 2013-02-24 22:31 xxx0624 阅读(594) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一些人,这些人要到同一个地点去,求最先到达的人。spfa(反向加边就行) 水~View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<queue> 5 #include<algorithm> 6 using namespace std; 7 const int maxn = 315; 8 const int maxm = 5015; 9 const int inf = 9999999; 10 int cnt,head 阅读全文
posted @ 2013-02-24 21:44 xxx0624 阅读(328) 评论(0) 推荐(0) 编辑