1094 The Largest Generation
发表于
DPS, 统计树的高度,以及每一层的结点个数,输出结点最多的是多少个以及哪一层。
1 | #include <bits/stdc++.h> |
1090 Highest Price in Supply Chain
发表于
重点在于理解这一句:
each number Si is the index of the supplier for the i-th member.
Si是第i个节点的父节点编号。
1 | #include <bits/stdc++.h> |