图的遍历
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.
题目描述
给出 个点, 条边的有向图,对于每个点 ,令 表示从点 出发,能到达的编号最大的点。现在请求出 的值。
输入格式
第 行 个整数 ,表示点数和边数。
接下来 行,每行 个整数 ,表示边 。点用 编号。
输出格式
一行 个整数 。
4 3
1 2
2 4
4 3
4 4 3 4
提示
- 对于 的数据,。
- 对于 的数据,。
2025CSP-J 图【李】
- Status
- Done
- Problem
- 26
- Open Since
- 2025-10-1 0:00
- Deadline
- 2025-11-7 23:59
- Extension
- 24 hour(s)