![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
HangShao99
将来的你一定会感谢现在拼命的自己~~~~
展开
-
有向图判定环
题目:https://ac.nowcoder.com/acm/contest/330/F分析:用拓扑排序/DFS来判断有向图是否有环,找到第一次出现环的边,也就是最后一次出现Yes的位置,可用二分找出该位置。用拓扑排序来判定环:#include<bits/stdc++.h>using namespace std;const int maxn=1e5+2;vector...原创 2019-01-30 12:41:49 · 580 阅读 · 0 评论 -
第k短路
题目:http://poj.org/problem?id=2449分析:第k短路板子题贴个板子:#include<cstdio>#include<cmath>#include<algorithm>#include<vector>#include<cstring>#include<queue>using...原创 2019-04-10 20:57:28 · 232 阅读 · 0 评论