摘要: /* Kruskal模板 */ struct edge{ int from; int to; int next; int value; bool operator<(const edge a) const{ return value<a.value ; } }; const int inf=0x3f3f3f3f; inl... 阅读全文
posted @ 2019-04-26 21:45 MENG_GE 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 当需要将两个数据合成一个数据是或当一个函数需要返回两个数据, 3 相当于一个结构体,存的两个变量是first,second,可以直接使用 4 5 */ 6 #include 7 using namespace std; 8 typedef pair p;//由于pair使用时比较繁琐 9 /... 阅读全文
posted @ 2019-04-26 21:18 MENG_GE 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 SPFA模板 3 */ 4 const int inf=0x3f3f3f3f; 5 inline int SPFA(int s){ 6 memset(dis,inf,sizeof(dis)); 7 queue q; 8 dis[s]=0; 9 q.push(s); 10 vis[s]=1; 11 while(... 阅读全文
posted @ 2019-04-26 21:16 MENG_GE 阅读(97) 评论(0) 推荐(0) 编辑