摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2680#include#include#include#includeusing namespace std;#define INF 100000000vector g[1002];int w[1002][1002],d[1002],vis[1002];struct edge{int u;int v;}e[100000];void spfa(int a,int n){ queue q; memset(vis,0,sizeof(vis));//不在队列中 for(int i=2;id[a]+w... 阅读全文
posted @ 2013-07-28 22:00 galaxy77 阅读(215) 评论(0) 推荐(0) 编辑
摘要: #include#include#define INF 1000000000using namespace std;int g[202][202],d[202],vis[202];int main(){ int i,j,m,n,a,b,c; while(scanf("%d%d",&n,&m)!=EOF) { memset(g,0,sizeof(g)); for(i=0;id[j]) { minn=d[j]; x=j; } vis[x]=1; for(j=0;j... 阅读全文
posted @ 2013-07-28 21:37 galaxy77 阅读(174) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;#define INF 100000000vector g[1002];int w[1002][1002],d[1002],vis[1002];struct edge{int u;int v;}e[100000];void spfa(int a,int n){ queue q; memset(vis,0,sizeof(vis));//不在队列中 for(int i=2;id[a]+w[a][b]) { d[b]=d[a]+... 阅读全文
posted @ 2013-07-28 21:36 galaxy77 阅读(183) 评论(0) 推荐(0) 编辑
摘要: #include#include#define INF 100000000using namespace std;int g[102][102],d[102],vis[102];int main(){ int i,j,m,n,a,b,c; while(scanf("%d%d",&n,&m)) { if(n==0&&m==0) break; memset(g,0,sizeof(g)); for(i=0;id[j]) { minn=d[j]; x=j; } ... 阅读全文
posted @ 2013-07-28 21:34 galaxy77 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionAlice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no less than k friends in common, they will become friends in several days. Currently, there are totally n people in the country, and m friendship among them. A 阅读全文
posted @ 2013-07-28 15:10 galaxy77 阅读(166) 评论(0) 推荐(0) 编辑