摘要: 题解:最短路,注意是无向图,而且有起点和终点相同的情况……#include #include #include #include #include #include using namespace std;const int N=20005;const int INF=9999999;typedef pairseg;mapmp;priority_queue,greater >q;int d[N],u[N],v[N],w[N],head[N],next[N],m,n,k,p,cnt,min;string begin,end,s;bool vis[N];void build(){ memse 阅读全文
posted @ 2014-03-19 15:19 forever97 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 题解:最短路~#include #include #include #include using namespace std;const int N=20005;const int INF=9999999;typedef pairseg;priority_queue,greater >q;int d[N],u[N],v[N],w[N],head[N],next[N],a,b,c,m,n,k,p,cnt,min;bool vis[N];void build(){ memset(head,-1,sizeof(head)); for(int e=1;ed[x]+w[e]){ ... 阅读全文
posted @ 2014-03-19 13:55 forever97 阅读(169) 评论(0) 推荐(0) 编辑