拓扑排序
Rancho__
这个作者很懒,什么都没留下…
展开
-
拓扑排序板子 hihocoder-1174
思路 不断删入度为1的点及其出边。 详解: https://blog.csdn.net/qq_38984851/article/details/82844186 #include <bits/stdc++.h> using namespace std; const int maxn=1e5+10; vector<int> vec[maxn]; int InDeg[maxn...原创 2019-09-02 20:03:32 · 132 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 - D Robots(概率dp+拓扑排序)
这题概率dp + 拓扑排序可以写 改天补解释 #include <bits/stdc++.h> using namespace std; const int maxn=1e5+10; vector<int>vec[maxn]; int indeg[maxn],seq[maxn]; double d[maxn],f[maxn]; int N,M,T,tot=0; void...原创 2019-09-02 20:09:29 · 147 阅读 · 0 评论 -
HDU1285-确定比赛名次(拓扑+优先队列)
对于拓扑排序,每次能入队的只有入度为0的点,所以用优先队列即可。 以及,第一组数据日常卡OJ,这组数据跳了一个点,我的程序这个版本也过不了(其实写了另一个版的),稍微改改更正确。 #include <bits/stdc++.h> using namespace std; const int maxn=510; vector<int> vec[maxn]; int inde...原创 2019-09-03 22:17:34 · 124 阅读 · 0 评论