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 sheeper at 2013-02-13 19:12:39 on Problem 3287
预处理一下,排好序
统计哪个尺寸的背包最多,容易想到 那个尺寸的 背包只能分开到不同的piece中去
然后开始从头分配包包,第一个分到piece 1,第二个分到piece 2……第piece+1个分到piece 1,如此循环。
这样保证了每个piece中的包满足相互嵌套,又保证了所有piece的背包数量的最大值达到最小(因为是尽可能平均分的)

输出格式貌似比较严格:
1每一行最后面不要出现多余空格
2最后一个case后面不要出现空行

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