随笔分类 - 图--最短路
摘要:#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...
阅读全文
摘要:#include "stdio.h" //最短路 Kruskal算法 存边,排序,并查集合并,直至要求的两点相通,输出最小结果 //hdu 1233#include "stdlib.h"struct node{ int x,y; int w;}line[10005];int ans...
阅读全文
摘要:#include "cstdio" //邻接表+spfa算法(不断松弛操作) hdu 2544#include "queue"#include "string.h"using namespace std;struct node { int x; int value; //价值 int next...
阅读全文
浙公网安备 33010602011771号