You need to read all of the cells, so it is O(NM) at least.
On 10 Jan 2012 08:29, "vivek dhiman" <[email protected]> wrote:

> :D
>
> If it was this easy..I would have not put up this question.
>
> I have a solution but that is not time efficient.
> Any one who can answer this with O(N) or O(Log N) ??
>
> On Sat, Jan 7, 2012 at 9:58 PM, Mayur Kala <[email protected]> wrote:
>
>> hey vivek hi,
>> i recevied your question for "Algorithm for filling water"
>>
>> As you can see that each figure is composed of 4 blocks..
>> So:
>> step 1 : Find the volume of one block;
>> Setp 2: Multiply this volume with 4 which gives you volume of any
>> figure (say : squre or any other as all are containing 4 blocks);
>> Step 2: You have n figures in the whole system, Multiply it with the
>> volume achieved by step2
>>
>> You have your ans.
>>
>> On 1/3/12, vivek dhiman <[email protected]> wrote:
>> > anyone ??
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Google Code Jam" 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.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" 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.
>>
>>
>
>
> --
> Regards
> Vivek Dhiman
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" 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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" 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