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 |
思路以K为根建树,遍历找出必须要经过的边,得边权和为sum, 要使dis最短,则有一点可以不返回,那点不就是要到的点 中离K最远的city吗?记为MAX,则mindis=sum*2-MAX。 一开始TLE 优化了下之后发现是WA。。。想不到招了 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator