摘要: 求的是最大强连通分量且字典序最小 阅读全文
posted @ 2019-02-16 20:22 海边微风起 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define INF 0x3f3f3f3f #define MAXN 1000010 #define MAXM 5010 inline int read() { int x = 0,ff = 1;char ch = getchar(); while(!isdigit(ch)) { if... 阅读全文
posted @ 2019-02-16 18:45 海边微风起 阅读(246) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define INF 0x3f3f3f3f #define MAXN 1000010 #define MAXM 5010 inline int read() { int x = 0,ff = 1;char ch = getchar(); while(!isdigit(ch)) { if... 阅读全文
posted @ 2019-02-16 18:02 海边微风起 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 先看一道裸题 分层图的典型应用,有K条免费边,除了原图外再建K层图。然后对于从每个点出的每一条边,连一条从此点到这条边终点所对应的上一层的点,边权为零,从一层到下一层相当于走了一条免费边。由于不需要走完所有的免费边,所以应取所有层的终点的最短路的最小值。 如图所示: 这里只画出来0号节点的免费边 阅读全文
posted @ 2019-02-16 14:04 海边微风起 阅读(203) 评论(0) 推荐(0) 编辑