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 zerocpp at 2011-05-05 14:46:28 on Problem 3628
POJ3628
Bookshelf 2
书架(续)
Farmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top.
农夫John最近为母牛图书馆又买了一个书架,但书架很快被填满,现在只有书架顶部有空了。
FJ has N cows (1 ≤ N ≤ 20) each with some height of Hi (1 ≤ Hi ≤ 1,000,000 - these are very tall cows). The bookshelf has a height of B (1 ≤ B ≤ S, where S is the sum of the heights of all cows).
John有N头母牛(1<=N<=20),每头母牛都有一个身高Hi(1<=Hi<=1e+6)。书架有个高度B(1<=B<=S,S是所有母牛的高度和)
To reach the top of the bookshelf, one or more of the cows can stand on top of each other in a stack, so that their total height is the sum of each of their individual heights. This total height must be no less than the height of the bookshelf in order for the cows to reach the top.
为了能碰到书架顶部,可能需要母牛叠罗汉,之后的总高度应该不小于书架高度。
Since a taller stack of cows than necessary can be dangerous, your job is to find the set of cows that produces a stack of the smallest height possible such that the stack can reach the bookshelf. Your program should print the minimal 'excess' height between the optimal stack of cows and the bookshelf.
因为过高的高度可能导致危险,所有你的程序应该求出最小能碰到书架的高度。

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