Search found 9 matches

by bakalar
Sat Sep 09, 2006 2:38 am
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

Unbelievable. Lol. I had that file on my hard drive since 2003. Thanks mate.
by bakalar
Fri Sep 08, 2006 1:31 am
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

It wouldn't work for most of the following

1
-8 -19
2
-13 -20
8 -4
3
17 16
8 13
-2 1
4
16 -7
-9 -3
3 7
16 -17
5
-19 14
18 20
-16 -10
8 7
11 -19
6
1 -5
8 -10
9 10
15 2
11 -6
-7 -9
7
9 -19
-10 4
6 4
15 -19
14 -7
5 -1
4 16
8
13 7
3 -10
0 -19
-19 -4
11 -7
13 5
-15 -11
-9 5
9
-4 -2
12 20
4 8
14 -9
-4 ...
by bakalar
Fri Sep 08, 2006 12:38 am
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

Nope. 2 Problems. You don't know for how long its gonna grow (90 rule is not valid eg. (0, 1) and (1000, -1000)). Secondly, it can grow for a while, then shrink, and then grow again, to an ever bigger distance.

Keep 'em coming.
by bakalar
Thu Sep 07, 2006 9:03 pm
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

Maybe, but no. They've done it in O(n^2).
by bakalar
Thu Sep 07, 2006 7:52 pm
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

I'm not so sure about that, but if you say it can be done easily, please do so!
by bakalar
Thu Sep 07, 2006 5:50 pm
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

Well, I was wondering if someone has seen it on any of the online judging systems. It's part of a private competition, and the formulation is not in English. Srry. The text is pretty much what I've said in post #1, and here is the example test case (input contains N<10000, and a pair of numbers on ...
by bakalar
Thu Sep 07, 2006 4:36 pm
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

[deleted]
by bakalar
Thu Sep 07, 2006 2:11 pm
Forum: Algorithms
Topic: Maximum sum of n vectors -> in O(n lg n)
Replies: 15
Views: 6485

Maximum sum of n vectors -> in O(n lg n)

Given n 2d vectors, you are to pick those which would get you furthest from (0, 0). I used the following properties -> t1 : vectors making up the max sum will be consecutive a circular list sorted by angle, t2-> anglespan of these vectors will be less than PI.

[EDIT]: I thought I had a solution ...
by bakalar
Fri Aug 11, 2006 5:58 am
Forum: Volume 5 (500-599)
Topic: 501 - Black Box
Replies: 35
Views: 22371

501 (Black Box)#$(%*#$!

Never mind, it got accepted.
mf wrote: The problem comes from NEERC' 1996 regionals. You can use the tests at http://www.acm.inf.ethz.ch/ProblemSetAr ... NERC/1996/ as a last resort.

Go to advanced search