View Single Post
Old 12-16-2004, 09:45 PM   #19
Alien426
'll take away your bucket
 
Alien426's Avatar
 
Join Date: Dec 2001
Location: the black
Posts: 2,037
OK, this time I actually thought it through.
spoiler:
You divide into 4 groups.
if(groupA != groupB)
 {
  if(groupA != groupC)
   {
    X = groupA
   }
  else
   {
    X = groupB
   }
 }
else
 {
  if(groupA != groupC)
   {
    X = groupC
   }
  else
   {
    // you are ****ed, since you can't tell
    // if the resulting group is heavier or
    // lighter than the rest
    X = groupD
   }
 }

You note whether the X-group is heavier or lighter than the other groups it's measured against. Then weigh two balls of the X-group (a and b).
If they weigh the same, the result is ball c. Otherwise the one that has the same traits that the X-group had (i.e. heavier or lighter) is the result.

Alien426 is offline   you may: quote & reply,