[gcj] Re: Egg Drop

2009-09-10 Thread SkipFire
Ignoring the programming and only addressing the logic to figure it out, one way to solve is using halves, so test at 32, 16, 8, 4, 2, 1. Of course if it breaks past 8 that gives you more than 3 breaks so that doesn't work by itself. So instead of doing halves you could drop by 75% and go 32, 8,

[gcj] Re: Egg Drop

2009-09-09 Thread sajith varghese
Sorry, I meant total floors only. No Black magic. If and else cases can be combined together as you are measuring the total number of floors, and each cases represent each side(below/top) of the current floor. Thanks On Wed, Sep 9, 2009 at 9:46 PM, Satyajit Malugu wrote: > @sajith > "so total bre

[gcj] Re: Egg Drop

2009-09-09 Thread Satyajit Malugu
@sajith "so total breaks become, 1 + F(D-1, B-1) + F(D-1,B)" Isn't it the total floors? That's what I got from code of top players. Also what I don't understand is - How you can combine if and else cases to a same equation - 1 + F(D-1, B-1) + F(D-1,B) May be I am missing something.. but all of th

[gcj] Re: Egg Drop

2009-09-08 Thread sajith varghese
will this makes the logic simple. want to find F(D,B) I drop an egg from some floor, if it breaks it will break on some floor below, and I have left B-1 breaks and D-1 drops. If it doesn't break I have to find a floor above the current floor and have B breaks and D-1 drops. so total breaks become,

[gcj] Re: Egg Drop

2009-09-08 Thread Hawston LLH
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 >> > >

[gcj] Re: Egg Drop

2009-09-08 Thread Jason Lepack
Sergey, You don't need to know why/how S(63,7,3) is possible, just know that it IS. On Tue, Sep 8, 2009 at 9:30 AM, Sergey Ochkin wrote: > > The problem statement looks quite clear to me. Specifically, it tells > that every test case in input file is "solvable", which means that > there is an al

[gcj] Re: Egg Drop

2009-09-08 Thread Jason Lepack
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 wh

[gcj] Re: Egg Drop

2009-09-08 Thread Jason Lepack
nd 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 >> >> Date

[gcj] Re: Egg Drop

2009-09-08 Thread Sergey Ochkin
The problem statement looks quite clear to me. Specifically, it tells that every test case in input file is "solvable", which means that there is an algorythm for determining the lowest floor where the egg breaks... However I discovered an inconsistency in the first (small) input file. It contains

[gcj] Re: Egg Drop

2009-09-08 Thread Bartholomew Furrow
> > 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. > "If breaks answer is 7" -- or 6, if you're looking for the highest floor from which it doesn't break. --~--~-~--~~~---~--~~ You received th

[gcj] Re: Egg Drop

2009-09-08 Thread Satyajit Malugu
gt; > 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 > > > > Date: Tue, 8 Sep 2

[gcj] Re: Egg Drop

2009-09-08 Thread Paul Smith
e 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----- &g

[gcj] Re: Egg Drop

2009-09-08 Thread Jason Lepack
: Tue, 8 Sep 2009 14:45:39 To: 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

[gcj] Re: Egg Drop

2009-09-08 Thread Paul Smith
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)