`

Another Google question - drop glassballs from a building 5

阅读更多
Here are some results are the testcases:

1. PathFindTest.test4Ball100Floors():
The result is like this:

path=(f=56, b=3, whole, tried)-->(f=91, b=3, broken, tried)-->(f=71, b=2, broken, tried)-->(f=61, b=1, whole, tried)-->(f=65, b=1, whole, tried)-->(f=68, b=1, whole, tried)-->(f=70, b=1, broken, tried)-->(f=69, b=0, whole, tried)-->END
number of trials=8

The last one has the status "whole", so we have to go back to the first trial with "broken" status, which is the one before last, and it has floor 70.

2. PathFindTest.test1BallSingleCase()
Th result is like this:

path=(f=1, b=0, whole, tried)-->(f=2, b=0, whole, tried)-->(f=3, b=0, whole, tried)-->(f=4, b=0, whole, tried)-->(f=5, b=0, whole, tried)-->(f=6, b=0, whole, tried)-->(f=7, b=0, whole, tried)-->(f=8, b=0, whole, tried)-->(f=9, b=0, whole, tried)-->(f=10, b=0, broken, deducted)-->END
number of trials=9

The last one has the "deducted" flag, this means this element will be excluded from the size of the path since it's a logic deduction, no real trial happened.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics