仅作记录,拓扑模板
//
// Created by 29273 on 2022-03-16.
//
#include "bits/stdc++.h"
using namespace std;
const int maxN = 1e4 + 10;
vector<int> V[maxN];
vector<int> ans;
int in[maxN];
int n, x, y, m;
void topSort() {
queue<int> Q;
for (int i = 1; i <= n; ++i) {
if (!in[i]) Q.push(i);
}
while (Q.size()) {
int top = Q.front();
Q.pop()<