Satyajit,

That's not true.  If you jump to 8 from 6, instead of seven and the
egg breaks on 8, you don't have an egg left to determine whether or
not the egg would break on floor seven, and therefore S(8,3,3) is
false.  You can't assume that since the egg broke on 8 that it
will/won't break on 7.

On Tue, Sep 8, 2009 at 10:02 AM, Satyajit
Malugu<[email protected]> wrote:
> Then why not the number is 8? Using your logic, 3 attempts and 3 broken eggs
> can be used on a 8 floor building.
>
> Part of the explanation.
> Attempt on 4, does not break, attempt on 6- does not break, attempt on 8. If
> breaks answer is 7 does not answer is 8.
> Attemp on 4, breaks, attempt on 2, breaks, attempt on 1- breaks then answer
> is 1.
> IMHO binary search on 7 and 8 are similar.
>
> On Tue, Sep 8, 2009 at 12:41 PM, Paul Smith <[email protected]>
> wrote:
>>
>> No.  With 3 drops, allowing 3 breaks, you can test 7 floors.  3,3,3
>> doesn't come into the solution, it's just a starting point.
>>
>> You drop the first egg at floor 4.  If it breaks then you try floor 2
>> next, else you try floor 6.  The 3rd egg goes either at floor 1, 3, 5,
>> or 7.  It's a simple binary search.
>>
>> (The implicit assumption is that if an egg breaks on floor 4, it will
>> also break on any higher floor.  If an egg does not break on floor 4,
>> it will also not break on any lower floor)
>>
>> On Tue, Sep 8, 2009 at 5:42 PM, Jason Lepack<[email protected]> wrote:
>> > I don't understand how 7 is achieved for max F in the first test case.
>> >  Since S(3,3,3) is true, it is determined that within three drops, allowing
>> > 3 breaks, it's known whether or not the egg will break at all floors less
>> > than or equal to 3.  Right?
>> >
>> > The leap to 7 is foggy for me.  I could see the answer being 6, as with
>> > three drops we could check 4,5, and 6.
>> >
>> > I know i'm missing something but I don't know what it is.  I'll admit
>> > it's a little frustrating ;)
>> > Sent on the TELUS Mobility network with BlackBerry
>> >
>> > -----Original Message-----
>> > From: Paul Smith <[email protected]>
>> >
>> > Date: Tue, 8 Sep 2009 14:45:39
>> > To: <[email protected]>
>> > Subject: [gcj] Re: Egg Drop
>> >
>> >
>> >
>> > The sample input has 2 test cases.  The first, 3 3 3, tell you that
>> > Solvable(3,3,3) is true. So, you are asked,
>> >
>> > what is the maximum number F such that Solveable(F,3,3) is true,
>> > what is the minimum number D such that Solveable(3,D,3) is true,
>> > what is the minimum number B such that Solveable(3,3,B) is true.
>> >
>> > The answer for this case is 7 2 1, as S(7,3,3), S(3,2,3) and S(3,3,1)
>> > are all true.
>> >
>> > Similarly, given that S(7,5,3) is true, S(25, 5, 3), S(7,3,3) and
>> > S(7,5,2) are all true, 7 5 3 -> 25 3 2
>> >
>> > On Tue, Sep 8, 2009 at 1:48 PM, LeppyR64<[email protected]> wrote:
>> >>
>> >> I'm having trouble understanding the problem statement.
>> >>
>> >> I understand what is expected for output, but not how to get from the
>> >> sample input to the output.
>> >> Could someone please explain the sample test case?
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Paul Smith
>> > http://www.nomadicfun.co.uk
>> >
>> > [email protected]
>> >
>> >
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Paul Smith
>> http://www.nomadicfun.co.uk
>>
>> [email protected]
>>
>>
>
>
>
> --
> Satyajit
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to