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

把小棍子从大到小排序,然后先组第一个3000,再组第二个3000,每次从前往后遍历一遍。

Posted by tengshengbo at 2005-08-08 21:40:33
In Reply To:问个题目,帮忙看看。谢谢! [见内] Posted by:queyue2004 at 2005-08-08 20:44:54
> 有一批钢材,长度为3000mm。需要将它们切割成长度不一的零件,问如何切割
> 才能使用料最少。
> 输入
> 第一行表示零件的种类n,之后是n行。
> 每一行包含两个数字 l , m,    l表示零件的长度,m表示需要的这种零件的个数
> 其中  m < 100,
> 
> 输出,输出总共需要的钢材的数量
> 
> sample 
> 
> 3
> 1500 3
> 1000 4
> 2000 2
> 
> 输出 6
> 
> [另] 如果还需要考虑钢材切割方式最少的方式,那怎么办?
> 比如以上的采用的切割方式有
> 1500 * 2
> 2000 + 1000
> 1000 * 3

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