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 foreverlin at 2009-11-14 13:44:10 on Problem 3538
//最小生成树+DP
//首先求得最小生成树,如果不能求得,那么Impossible
//这样我们得到了生成树中边的全部信息,问题转化成了给定n个边
//有两种材料,分别有价格和库存,每条边只能由一种材料来构造,求最少的代价,并给出一个方案 
//由于长度是和边之和对应的,于是可以设dp[i]为一共有和为i的边,使用了5号电缆,最多10000个状态
//假定可行那么剩下的边必定是用6号,我们只需要判定够不够用即可,由于还要输出解,对于每个dp[i]
//增加一个数组用来表示最后加进来的边的边号
//整个算法的复杂度大概为10^7 

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