Search found 2 matches

by Animosity
Thu Sep 23, 2004 9:12 pm
Forum: Volume 107 (10700-10799)
Topic: 10715 - Cat
Replies: 11
Views: 8363

so true..too bad i didnt thought of it in time
by Animosity
Thu Sep 23, 2004 4:33 pm
Forum: Volume 107 (10700-10799)
Topic: 10715 - Cat
Replies: 11
Views: 8363

ok...where does my logic fail me?

Since there will always be a solution i'm using the following simple algorithm:

-sort weights in decreasing order
-have 2 sums s1=s2=0
-s1 += heaviest rock
-s2 += next heaviest
-recursively...compare s1 to s2 and add the next rock to whichever is smaller
- we end ...

Go to advanced search