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 |
一种新思路将每条边取对数再取相反数存在新图G'里,然后在G'上运行Bellman-Ford计算负环即可,因为题中要判断原图中是否有回路的边权乘积大于1,而这等价于边权的对数的相反数的和小于0,从而可以将原题转化为在新图上判负环的问题。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator