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

Re:请问大家是用什么方法做的啊??我写的prim要15000+K,但别人的都几百K~~

Posted by waterman0079 at 2009-04-08 16:37:31 on Problem 2395
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:
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