摘要: memset(a,127,sizeof(a)); 即得到无穷大。 memset(a,128,sizeof(a)); 即得到无穷小,与上述的值互为相反数。 memset(a,60,sizeof(a)); 即近似为第一个式子的数值的一半。 memset(a,0,sizeof(a));赋值0 memset(a,-1,sizeof(a));赋值-1 阅读全文
posted @ 2019-01-20 16:30 DWVictor 阅读(933) 评论(0) 推荐(0)
摘要: void Add(int u,double cost,int v)//邻接表存储关系 { w[top] = cost; Key[top] = v; next[top] = head[u]; head[u] = top++; } bool SPFA(int x) { memset(vis,false, 阅读全文
posted @ 2019-01-20 14:01 DWVictor 阅读(417) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int INF=0x3f3f3f3f; const int N=210; int n,m,s,t; int map[N][N],dis[N 阅读全文
posted @ 2019-01-20 13:38 DWVictor 阅读(218) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<iostream> #include<queue> using namespace std; #define N 205 #define INF 99999999 int n,m,map[N][N]; int visited[N],dis[N]; 阅读全文
posted @ 2019-01-20 13:38 DWVictor 阅读(275) 评论(0) 推荐(0)
摘要: 刘汝佳 #include<cstdio> #include<cstring> #include<vector> #include<algorithm> #include<queue> using namespace std; #define INF 1e8 const int maxn = 200+ 阅读全文
posted @ 2019-01-20 13:37 DWVictor 阅读(258) 评论(0) 推荐(0)