by heart

来源: badminton 2010-05-04 11:06:38 [] [旧帖] [给我悄悄话] 本文已被阅读: 次 (1794 bytes)
This is not really hard (by heart too). Just follow logic and use all information you have.
Number the balls, b1,b2,...,b13
(1) balance (b1,b2,b3,b4) vs (b5,b6,b7,b8)
IF( (1) is balanced) then ----IF 1
(2) balance (b9,b10) vs (b11,b1)
If((2) balanced) then (go to be either b12 or b 13)
(3) balance (b1) vs (b12) then
if((3) balanced) then
the ball is b13
else
the ball if b12
endif
else ((2) is not balanced) (go to be one of b9,b10,b11, suppose left is heavier
in step (2).)
(3.a) balance (b9) vs (b10)
if( (3.a) balanced) then
ball is b11
else
Now we are sure the ball is heavier.
The heavier side is the ball, either b9 or b10.
endif
endif
ELSE( (1) is not balanced) ----ELSE 1
put b6,b7,b8 aside (and remember which side was heavier in step (1),
assume it was left)
(2.a) balance (b1,b2,b5) vs (b3,b9,b10)
if( (2.a) is balanced) then (b6 or b7 or b8 and the ball is lighter)
(3.b) balance b6 vs b7
if( (3.b) is balanced) then
b8 is the ball
else
the ball is the lighter one either b6 or b7
endif
else ( (2.a) is no balanced
Does 2.a changed original direction of unbalance?
if(yes) the ball get to be either b3 or b5
(3.c) balance b1 vs b3
if( (3.c) balanced) then
the ball is b5
else
the ball is b3
endif
else (No. it does not changed original direction of unbalance)
In this case only b1 or b2 can be the ball.
(3.d) balance b1 vs b2
The heavier one is the ball.
endif
ENDIF ---- IF 1

所有跟帖: 

From If(2), b12&b13, you didn't tell the ball is ligher or heav -twfx- 给 twfx 发送悄悄话 (28 bytes) () 05/04/2010 postreply 15:53:01

Be careful. -jinjing- 给 jinjing 发送悄悄话 (82 bytes) () 05/04/2010 postreply 16:07:56

请您先登陆,再发跟帖!

发现Adblock插件

如要继续浏览
请支持本站 请务必在本站关闭/移除任何Adblock

关闭Adblock后 请点击

请参考如何关闭Adblock/Adblock plus

安装Adblock plus用户请点击浏览器图标
选择“Disable on www.wenxuecity.com”

安装Adblock用户请点击图标
选择“don't run on pages on this domain”