| 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 Regional Jakarta 2008 (ext)
ACM ICPC Regional Jakarta 2009 (ext)
ACM ICPC Regional Jakarta 2010
ACM ICPC Regional Jakarta 2012 - Problem H (new!)
ACM ICPC World Final Tokyo 2007
Google India Code Jam 2005
Google India Code Jam 2006
Indonesia National Contest 2007
Indonesia National Contest 2008
Indonesia National Contest 2010
Facebook Hacker Cup 2011
|
||
Problem StatementYou are given a set of two-dimensional vectors in two int[]s - x and y (the i-th elements of x and y represent x and y coordinates of the i-th vector). Find a subset of the vectors such that the sum of all vectors in the subset has the maximum possible length. Return this length. DefinitionClass: VectorSet Method: maxLength Parameters: int[], int[] Returns: double Method signature: double maxLength(int[] x, int[] y) (be sure your method is public) Notes
Constraints
Examples
0)
{0,0}
{1,-1}
Returns: 1.0
Choose any one vector.
1)
{0, 0}
{1, 1}
Returns: 2.0
Choose two vectors. The sum is (0, 2).
2)
{0, 0, 1, -1}
{1, -1, 0, 0}
Returns: 1.4142135623730951
3)
{0, 0, 0, 0}
{1, 2, -1, -2}
Returns: 3.0
4)
{17,8,-5,-8,-8,-11,-3,2,19,4,22,15,20,13,-7,15,-23,17,-9,-10,17,24,20,-22,-1,-7,-19,18,-17}
{7,-5,-2,18,-9,-24,14,9,-21,14,-23,7,14,23,23,17,17,22,-3,-21,-10,1,24,-17,25,12,-21,12,13}
Returns: 289.4563870430224
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
|
||