Here is the mathematical formula :
double a = log(log(P/L,C),2);
int a_int = a;
while(a_int < a) a_int++;
a_int = max(a_int, 0);
On 23 May 2010 17:49, Bharath Raghavendran <[email protected]> wrote:
> You are trying to find a value of a between L and P such that u r sure that
> a contestants can access at a time but C*a contestants cannot.
>
> Its basically a binary search for a satisfying element between L and P with
> a small modification that instead of taking (L+P)/2 each time, go for their
> geometric mean. This will maintain the ratio of first and last between the
> two halves and hence will be most optimal.
>
>
> On 23 May 2010 17:40, Saurabh Aggarwal <[email protected]> wrote:
>
>> Hi Guys,
>>
>> Could anyone please explain the logic behind the "Load Testing" problem ?
>> From the solutions I gathered that they have found the number of bits in
>> X, where
>>
>> L * (C^X) > P
>>
>> But couldn't understand why this was done ?
>>
>> Thanks.
>>
>> --
>> Regards,
>> Saurabh Aggarwal
>>
>> --
>> 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]<google-code%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
--
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.