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 2010-01-19 21:07:02 on Problem 1827
//题目描述:一共有x个盒子,一个盒子有一个数,一个数只能放在一个盒子里
//有n个怪兽,每个随机检起一张卡片,打开获得的数字为d[i],不能改变且不能再打开其他盒子,d[i]范围[1,m]
//如果第i个怪兽获得数字d[i],他只能打开编号<=d[i]的盒子,一个盒子只能给一个怪兽,一个怪兽只能由一个盒子
//jim有权利去分配,他知道第i个怪兽的能力为s[i],问题要使得所有没有获得盒子的怪兽的s[i]之和sum最小
//首先我们按s从大到小排序,如果s相同,那么按d的值从大到小,这样做是为了尽量先把s大的安顿好,因为惹不起
//每次都采取靠后原则,俗话说的好,物尽其用,这里的数字也是一样,然后用并查集保留下当前最近的那个祖先 

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