hdu 5606 tree(并查集)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5606

tree

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1183    Accepted Submission(s): 527

Problem Description
There is a tree(the tree is a connected graph which contains n points
and n1 edges),the
points are labeled from 1 to n,which
edge has a weight from 0 to 1,for every point i[1,n],you
should find the number of the points which are closest to it,the clostest points can contain i itself.
 

Input
the first line contains a number T,means T test cases.

for each test case,the first line is a nubmer n,means
the number of the points,next n⑴ lines,each line contains three numbers u,v,w,which
shows an edge and its weight.

T50,n105,u,v[1,n],w[0,1]

 

Output
for each test case,you need to print the answer to each point.

in consideration of the large output,imagine ansi is
the answer to point i,you
only need to output,ans1 xor ans2 xor ans3.. ansn.

 

Sample Input
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

波比源码 » hdu 5606 tree(并查集)

发表评论

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系站长
赞助VIP 享更多特权,建议使用 QQ 登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡