可达性统计
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
给定一张 个点 条边的有向无环图,分别统计从每个点出发能够到达的点的数量。
输入格式
第一行两个整数 ,接下来 行每行两个整数 ,表示从 到 的一条有向边。
输出格式
输出共 行,表示每个点能够到达的点的数量。
10 10
3 8
2 3
2 5
5 9
5 9
2 3
3 9
4 8
2 10
4 9
1
6
3
3
2
1
1
1
1
1
提示
测试数据满足 ,。