随笔分类 -  图--最短路

摘要:#include "stdio.h" //最短路 dijkstra模板 //hdu 1233#include "string.h"#define MAX 0x3fffffffint map[105][105];int main(){ int n,m; int x,y,k; int... 阅读全文
posted @ 2013-11-28 14:29 ruo_yu 阅读(182) 评论(0) 推荐(0)
摘要:#include "stdio.h" //最短路 Kruskal算法 存边,排序,并查集合并,直至要求的两点相通,输出最小结果 //hdu 1233#include "stdlib.h"struct node{ int x,y; int w;}line[10005];int ans... 阅读全文
posted @ 2013-11-28 14:24 ruo_yu 阅读(248) 评论(0) 推荐(0)
摘要:#include "cstdio" //邻接表+spfa算法(不断松弛操作) hdu 2544#include "queue"#include "string.h"using namespace std;struct node { int x; int value; //价值 int next... 阅读全文
posted @ 2013-11-27 15:30 ruo_yu 阅读(190) 评论(0) 推荐(0)