forked from liuxinyu95/AlgoXY
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
21 lines (15 loc) · 929 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1D problem:
Given n non-negative integers representing an elevation map where the width of each bar is 1,
compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6.
2D problem:
http://www.oi.edu.pl/old/php/show.php?ac=e181413&module=show&file=zadania/oi6/woda
On a rectangular mesh comprising n*m fields, n*m cuboids were put, one cuboid on each field.
A base of each cuboid covers one field and its surface equals to one square inch. Cuboids on
adjacent fields adhere one to another so close that there are no gaps between them.
A heavy rain pelted on a construction so that in some areas puddles of water appeared.
Write a program which:
reads from the text file WOD.IN a size of the chessboard and heights of cuboids put on the
fields, computes maximal water volume, which may gather in puddles after the rain,
writes results in the text file WOD.OUT.