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 |
floyd 果然是DP,运用广泛 。gcd和lcm满足分配率 , 再推一下公式,就可以得到转移方程,注意多条路径都适合,所以是lcm()dp[i][j] = lcm(gcd(dp[i][j] , dp[i][k] , gcd(dp[i][j] , dp[k][j])) ; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator