文章
6
粉丝
32
获赞
0
访问
2.5k
//#include <bits/stdc++.h>
#include <iostream>
#include <unordered_set>
#include <queue>
using namespace std;
#define maxn 505
#define for_(i,a,b) \
for (int i = (a); i < (b); i++)
unordered_set<int> G[maxn];
int indegree[maxn];
int n, m;
void init() {
for_(i, 0, maxn) G[i].clear();
memset(indegree, 0, sizeof(indegree));
}
void topo() {
priority_queue<int, vector<int>, greater<int>> pq;
for (int i = 1; i <= n; i++)
{
if (indegree[i] == 0) {
pq.push(i);
}
}
int count = 0;
while (!pq.empty()) {
auto t = pq.top();
&n...
登录后发布评论
暂无评论,来抢沙发