![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
洛谷
summermoonlight
满船清梦压星河
展开
-
洛谷 P1983 [NOIP2013 普及组] 车站分级
topsort #include<iostream> #include<cstring> #include<algorithm> #include<vector> #include<queue> using namespace std; const int maxn = 1010; int n, m; int a[maxn]; bool is[maxn]; int g[maxn][maxn]; int dis[maxn]; int d[maxn]原创 2021-05-24 19:15:24 · 169 阅读 · 0 评论 -
洛谷 P3916 图的遍历
正向建边+记忆化搜索:不行,因为有环 正确思路:反向建边+dfs #include<iostream> #include<cstring> #include<vector> #include<algorithm> using namespace std; const int maxn = 1e5 + 10; int n, m; int maxres; vector<int> g[maxn]; int dp[maxn]; bool vi[max原创 2021-05-24 13:40:09 · 80 阅读 · 0 评论