Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一种新思路

Posted by YanXB at 2015-03-13 13:21:17 on Problem 2240
将每条边取对数再取相反数存在新图G'里,然后在G'上运行Bellman-Ford计算负环即可,因为题中要判断原图中是否有回路的边权乘积大于1,而这等价于边权的对数的相反数的和小于0,从而可以将原题转化为在新图上判负环的问题。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator