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 npbool at 2016-03-07 20:57:32 on Problem 3463
主流做法是用Dijkstra
实际可以用任意最短路算出每个节点到终点的最短距离dist[u], 然后按dist[u]升序依次松弛每个节点,对等于最短路长度的路径数量dp(dist[u]-w(u,v)==dist[v]则把cnt[v]累加到cnt[u]),
最后再对等于最短路长度+1的路径数量dp(dist[u]-w(u,v)+1==dist[v])
比较麻烦就是了

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