A rectangular plot comprising n*m cells on which n*m blocks (cement block
in shape of a cube) were kept, one block per each cell. The base of each
block covers one cell completely and its surface is equals to one square
meter. Cubes on adjacent cell are so close that there are no gaps between
them. Due to a heavy rain on the construction, water is accumulated in the
gaps created between a group of blocks due to the difference in their
heights.  Write a program to calculate the volume of water accumulated
between the blocks on the construction.

The below image depicts the water collected in the gaps of the building
blocks due to their respective heights.


Input is something like this rows->3 cols->6
height of each block row wise-> {{3,3,4,4,4,2},{3,1,3,2,1,4},{7,3,1,6,4,1}})
answer 5

On Thu, Dec 29, 2011 at 1:23 PM, Aurelian Tutuianu <[email protected]>wrote:

> How the input of the problem is given? For some type of input formats is
> possible to do something better than n^2.
> How the problems statements looks like?
>
> On Fri, Dec 16, 2011 at 8:46 AM, vivek dhiman <[email protected]>wrote:
>
>> Hi all
>>
>> Can you suggest what algorithm can be used for such a problem.
>>
>> There are voids formed using blocks as shown in example file attached...
>>
>> I want to find out the volume of voids...
>>
>>
>> What algorithm you guys suggest ?
>>
>> Thanks
>>
>>  --
>> 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.

Reply via email to