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 |
一个不太一样的思路主流做法是用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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator