![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
拓扑排序
蜗角虚名羊
这个作者很懒,什么都没留下…
展开
-
洛谷P1038 神经网络
题解: 拓扑排序,难度挺低,但是细节很多。 其中一个注意点:c[i]即便是负数,也要进队,不然有些点入度始终大于0,更新不了 #include<bits/stdc++.h> using namespace std; struct kk{ int x,y; }a[103]; struct node{ int to,ne,w; }e[10003]; int n,m,i...原创 2018-05-17 20:05:02 · 317 阅读 · 0 评论 -
洛谷P1983 车站分级
这题有三种做法 1.O(nm2)1.O(nm2)1.O(nm^2) 488ms / 9.61MB / 0.68KB 不用讲,直接贴代码 #include<bits/stdc++.h> using namespace std; const int N=1002; int n,m,i,j,a[N],d[N],ans,f[N],k,vi[N][N],c[N][N],l; ...原创 2018-07-12 20:21:02 · 3124 阅读 · 5 评论 -
bzoj4010: [HNOI2015]菜肴制作
题目 Solution 讲课的PPT里的图 Code #include<bits/stdc++.h> using namespace std; const int N=100002; struct node{ int to,ne; }e[N]; int T,i,d[N],x,y,ans[N],n,m,tot,h[N],cnt; priority_queue<int>q;...原创 2019-02-17 13:53:35 · 207 阅读 · 0 评论