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

floyd 果然是DP,运用广泛 。gcd和lcm满足分配率 , 再推一下公式,就可以得到转移方程,注意多条路径都适合,所以是lcm()

Posted by 2742195759 at 2015-11-11 21:24:20 on Problem 2132
dp[i][j] = lcm(gcd(dp[i][j] , dp[i][k] , gcd(dp[i][j] , dp[k][j])) ; 

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