题目链接
https://www.luogu.org/problem/P2341
分析
Tarjan缩点,最后DAG中,唯一的出度为 0 0 0 的点的大小即为答案。
AC代码
#include <cstdio>
#include <algorithm>
#include <stack>
using namespace std;
inline int read() {
int num = 0;
char c = getchar();
while (c < '0' || c > '9') c = getchar();
while (c >= '0' && c <= '9')
num = num * 10 + c - '0', c = getchar();
return num;
}
const int maxn = 1e4 + 5, maxm