摘要: 这题就是稠密图,所以我们就用Prim。然后题中要求的是需要新建的路的最小值,所以已经建成的路,我们直接使用就可以了,把它设置为0,然后走这条路就是最短的。这题还是多组输入输出,所以还是用while循环输入。#include int map[105][105]... 阅读全文
posted @ 2019-02-15 18:01 xyee 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 这题kruscal跑的好快,嗯,就是一道板子题,很简单。输入的话,输入看着很繁琐,所以就用了cin。#include #include using namespace std;struct Edge { int f, t, c; bool ope... 阅读全文
posted @ 2019-02-15 17:06 xyee 阅读(99) 评论(0) 推荐(0) 编辑