网站页面
当前课程
成员
General
主题 1
主题 2
主题 4
主题 5
主题 6
主题 7
主题 8
主题 9
主题 10
主题 11
主题 12
主题 13
主题 14
主题 15
主题 16
主题 17
主题 18
主题 19
主题 20
[USACO Open12]淹没岛屿
成绩 | 0 | 开启时间 | 2013年02月21日 星期四 23:02 |
折扣 | 0.8 | 折扣时间 | 2013年02月28日 星期四 23:02 |
允许迟交 | 是 | 关闭时间 | 2013年02月28日 星期四 23:02 |
输入文件 | islands.in | 输出文件 | islands.out |
considered to be underwater.
An example is shown above: on the left, we have added just over 1 unit of water, which leaves 4 islands (the maximum we will ever see). Later on, after adding a total of 7 units of water, we reach the figure on the right with only two islands exposed. Please compute the maximum number of islands we will ever see at a single point in time during the storm, as the water rises all the way to the point where the entire field is underwater. PROBLEM NAME: islands INPUT FORMAT: * Line 1: The integer N. * Lines 2..1+N: Line i+1 contains the height H(i). (1 <= H(i) <= 1,000,000,000) SAMPLE INPUT (file islands.in): 8 3 5 2 3 1 4 2 3 INPUT DETAILS: The sample input matches the figure above. OUTPUT FORMAT: * Line 1: A single integer giving the maximum number of islands that appear at any one point in time over the course of the rainstorm. SAMPLE OUTPUT (file islands.out): 4
water, which leaves 4 islands (the maximum we will ever see). Later on, after adding a total of 7 units of water, we reach the figure on the right with only two islands exposed. Please compute the maximum number of islands we will ever see at a single point in time during the storm, as the water rises all the way to the point where the entire field is underwater. PROBLEM NAME: islands INPUT FORMAT: * Line 1: The integer N. * Lines 2..1+N: Line i+1 contains the height H(i). (1 <= H(i) <= 1,000,000,000) SAMPLE INPUT (file islands.in): 8 3 5 2 3 1 4 2 3 INPUT DETAILS: The sample input matches the figure above. OUTPUT FORMAT: * Line 1: A single integer giving the maximum number of islands that appear at any one point in time over the course of the rainstorm. SAMPLE OUTPUT (file islands.out): 4