文件名称:BigHole
介绍说明--下载内容均来自于网络,请自行研究使用
从横截面图来看,坑底成阶梯状,由从左至右的 1..N 个的平面构成(其中 1 ≤ N ≤ 100,000),如图:
* * :
* * :
* * 8
* ** * 7
* ** * 6
* ** * 5
* ********* 4 <- 高度
* ********* 3
************** 2
************** 1
平面 | 1 |2| 3 |
每个平面 i 可以用两个数字来描述,即它的宽度 Wi 和高度 Hi,其中 1 ≤ Wi ≤ 1,000、1 ≤ Hi ≤ 1,000,000,而这个坑最特别的地方在于坑底每个平面的高度都是不同的。灌水点设在坑底位置最低的那个平面,每分钟灌水量为一个单位(即高度和宽度均为 1)。随着水位的增长,水自然会向其它平面扩散,当水将某平面覆盖且水高达到一个单位时,就认为该平面被水覆盖了。
计算每个平面被水覆盖的时间。
输入的第一行是一个整数 N,表示平面的数量。后N 行上分别有两个整数,分别表示平面的宽度和高度。-From the cross-section view, bottom is stepped from left to right 1 .. N from a planar configuration (where 1 ≤ N ≤ 100,000), as: i each plane can be used to describe the two numbers that its width Wi and height Hi, where 1 ≤ Wi ≤ 1,000,1 ≤ Hi ≤ 1,000,000, and this is the most special place pit Bottom height of each plane is different. Irrigation point located at the lowest position of the flat bottom of the pit, irrigation amount per minute is a unit (ie, height and width are both 1). With the increase in the water level, the water will naturally diffused to other plane, a plane will be overwritten when the water and high water reaches a unit, they think that the plane is covered with water. Calculated for each plane is covered by water time.
* * :
* * :
* * 8
* ** * 7
* ** * 6
* ** * 5
* ********* 4 <- 高度
* ********* 3
************** 2
************** 1
平面 | 1 |2| 3 |
每个平面 i 可以用两个数字来描述,即它的宽度 Wi 和高度 Hi,其中 1 ≤ Wi ≤ 1,000、1 ≤ Hi ≤ 1,000,000,而这个坑最特别的地方在于坑底每个平面的高度都是不同的。灌水点设在坑底位置最低的那个平面,每分钟灌水量为一个单位(即高度和宽度均为 1)。随着水位的增长,水自然会向其它平面扩散,当水将某平面覆盖且水高达到一个单位时,就认为该平面被水覆盖了。
计算每个平面被水覆盖的时间。
输入的第一行是一个整数 N,表示平面的数量。后N 行上分别有两个整数,分别表示平面的宽度和高度。-From the cross-section view, bottom is stepped from left to right 1 .. N from a planar configuration (where 1 ≤ N ≤ 100,000), as: i each plane can be used to describe the two numbers that its width Wi and height Hi, where 1 ≤ Wi ≤ 1,000,1 ≤ Hi ≤ 1,000,000, and this is the most special place pit Bottom height of each plane is different. Irrigation point located at the lowest position of the flat bottom of the pit, irrigation amount per minute is a unit (ie, height and width are both 1). With the increase in the water level, the water will naturally diffused to other plane, a plane will be overwritten when the water and high water reaches a unit, they think that the plane is covered with water. Calculated for each plane is covered by water time.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
001 综教楼后的大坑csdn.cpp