I used that same formula to solve the problem too (I was looking the
interval of clicks the lamp switched on) and it worked perfect. But reading
the contest analisys... i think analisys' solution is more elegant and
simply than mine... :)

Well, the problem was solved and that's the important :D


2010/5/9 Abdelrhman Abotaleb <[email protected]>

> Ok I'm want really to discuss it
> because I solve it using a very simple way.
> only single operation!!!  :D :D
> I deduced a formula relates the number of snappers by the number of clicks
> if it satisfy the formula so the lamp is ON ;otherwise the lamp is off
>
> Indeed this method is sooooooooooooooo efficient for the large data set
> input .
>
> Really in the first I solve it straightforward using recursion algorithms
> and  so on
>
>
> The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
> should be an integer  number.
> If anyone really interested  i may include how to deduce the formula
>
> Good Luck
>
>
> On Sun, May 9, 2010 at 9:26 AM, Varun Nischal <[email protected]>wrote:
>
>> Hello all,
>>
>> Is anyone interested in discussing the algorithm for Snapper Chain.
>> What was the right approach to it?
>>
>> PS: I have seen some solved source code. But, would like to know about the
>> approach.
>>
>> Thanks,
>> Varun
>>
>> --
>> 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]<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.

Reply via email to