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:请问大家是用什么方法做的啊??我写的prim要15000+K,但别人的都几百K~~In Reply To:请问大家是用什么方法做的啊??我写的prim要15000+K,但别人的都几百K~~ Posted by:hzx at 2009-03-30 15:27:25 题目的要求的就是1到i(2……n)的路径上的最大边(对每条路径要保证最小)的最大值。用dijkstra的变种可以解决(空间复杂度可能高点),用最小生成树就很快了,根据题目要求用prim可能空间上还是比较不划算的(n*n=4000000),用kru**的话就只要(m=10000)了…… Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator