Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
其实只要简单的定义判断~~只要满足以下定义就算树: 1.根节点入度为0,其他各点入度为1 2.边的数目=点的数目-1 只要满足这些条件,就肯定是树。已经包含判断环,森林等条件了,有兴趣的各位可以推推看。 只要在输入的时候记录下每个点的入度,边的数目,点的数目即可... Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator