摘要: #include #include #include #include using namespace std; const int N=20005; const int INF=9999999; typedef pairseg; priority_queue,greater >q; int d[N],head[N],u[N],v[N],w[N],next[N],n,m,a,b,c; bool vis[N]; void build(){ memset(head,-1,sizeof(head)); for(int e=1;ed[x]+w[e]){ ... 阅读全文
posted @ 2014-03-24 09:32 forever97 阅读(411) 评论(0) 推荐(0) 编辑
摘要: 最短路,建图太麻烦,略过……#include #include #include const int INF=9999999; using namespace std; struct node{ int v,i; node(int a,int b){v=a,i=b;} bool operator a.v;} }; int n,m,map[500][500]; int done[500],d[500]; int dij(){ priority_queue q; memset(done,0,sizeof done); ... 阅读全文
posted @ 2014-03-24 09:29 forever97 阅读(228) 评论(0) 推荐(0) 编辑