树根和孩子
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.
Background
给定一棵树,输出树的根root,孩子最多的结点max以及他的孩子
Format
Input
n(结点数<=100),m(边数<=200)。
以下m行;每行两个结点x和y, 表示y是x的孩子(x,y<=1000)。
Output
第一行:树根:root。
第二行:孩子最多的结点max。
第三行:max的孩子。
Samples
8 7
4 1
4 2
1 3
1 5
2 6
2 7
2 8
4
2
6 7 8
Limitation
1s, 1024KB for each test case.
数据结构-栈与队列 树
- Status
- Done
- Problem
- 6
- Open Since
- 2025-5-22 0:00
- Deadline
- 2025-6-13 23:59
- Extension
- 24 hour(s)