| Felix Halim .NET | ||
|
University Experience
IOI 2002 Yong In, Korea
ACM ICPC Regional Manila 2003
ACM ICPC Regional Manila 2004
ACM ICPC Regional Manila 2005
ACM ICPC Regional Kaohsiung 2006
ACM ICPC Regional Singapore 2007
ACM ICPC World Final Tokyo 2007
Google India Code Jam 2005
Google India Code Jam 2006
Indonesia National Contest 2007
Indonesia National Contest 2008
|
||
Problem StatementWhile building a tower, workers want to lift boxes up from the ground floor to the top floor using elevators. There are two types of boxes. Each box has a weight 50 or 100. Each elevator has enough space for up to two boxes, and can carry a maximum combined weight of 150. Each elevator can only be used once. Given a int[] boxWeights containing the weight of each box, return the minimum number of elevators necessary to transport all the boxes. DefinitionClass: TowerLifts Method: leastNumber Parameters: int[] Returns: int Method signature: int leastNumber(int[] boxWeights) (be sure your method is public) Constraints
Examples
0)
{50, 100, 50, 50, 50}
Returns: 3
There are two boxes in the first elevator: 50, 100. The second elevator contains: 50 and 50. The third elevator contains only one box: 50.
1)
{100, 100, 50, 100}
Returns: 3
2)
{50, 50}
Returns: 1
3)
{50, 50, 100, 100}
Returns: 2
4)
{50, 50, 100, 100, 50, 100, 50, 50, 50}
Returns: 5
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. Google India Code Jam 2006 - Table of Contents
|
||