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 |
Re:提醒使用相鄰矩陣的同學...In Reply To:提醒使用相鄰矩陣的同學... Posted by:soultama at 2011-06-16 04:49:22 > 吃輸入資料的時候只要留下權重最小的邊,因為測試數據會有parallel edges陷阱... > > 另外是測試數據都會連通Node 1,所以可以放心在第1個點用Single source Bellman-Ford。 > > 附上我測試用的數據,希望會幫到忙 > > 3 > 5 3 1 > 2 3 1 > 2 5 1 > 3 4 1 > 4 5 10 > 4 3 1 > 1 2 1 > 2 3 1 > 3 4 1 > 4 2 2 > 2 1 1 > 1 2 10 > 1 2 11 > 1)這讓人很無言, 實際上應該是YES(2->3->4->5->2), 不過我輸出NO的程序就是AC了 > 2)NO (2->3->4->2的值是0, 回不了過去) > 3)YES Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator