1553_Flooded!

2022-5-16 18:17| 发布者: Hocassian| 查看: 26| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-2-89503964153300-Problem List-采集的数据-后羿采集器.html

Pro.ID

1553

Title

Flooded!

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=1553

AC

5

Submit

5

Ratio

100.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    To enable homebuyers to estimate the cost of floodinsurance, a real-estate firm provides clients with the elevation of each10-meter by 10-meter square of land in regions where homes may be purchased.Water from rain, melting snow, and burst water mains will collect first inthose squares with the lowest elevations, since water from squares of higherelevation will run downhill. For simplicity, we also assume that storm sewersenable water from high-elevation squares in valleys (completely enclosed by stillhigher elevation squares) to drain to lower elevation squares, and that waterwill not be absorbed by the land.

    From weather data archives, we know the typical volume of water that collectsin a region. As prospective homebuyers, we wish to know the elevation of thewater after it has collected in low-lying squares, and also the percentage ofthe region's area that is completely submerged (that is, the percentage of10-meter squares whose elevation is strictly less than the water level). Youare to write the program that provides these results.

    输入

    The input consists of asequence of region descriptions. Each begins with a pair of integers, mand n, each less than 30, giving the dimensions of the rectangularregion in 10-meter units. Immediately following are m lines of nintegers giving the elevations of the squares in row-major order. Elevationsare given in meters, with positive and negative numbers representing elevationsabove and below sea level, respectively. The final value in each region descriptionis an integer that indicates the number of cubic meters of water that willcollect in the region. A pair of zeroes follows the description of the lastregion.

    输出

    Description

    To enable homebuyers to estimate the cost of floodinsurance, a real-estate firm provides clients with the elevation of each10-meter by 10-meter square of land in regions where homes may be purchased.Water from rain, melting snow, and burst water mains will collect first inthose squares with the lowest elevations, since water from squares of higherelevation will run downhill. For simplicity, we also assume that storm sewersenable water from high-elevation squares in valleys (completely enclosed by stillhigher elevation squares) to drain to lower elevation squares, and that waterwill not be absorbed by the land.

    From weather data archives, we know the typical volume of water that collectsin a region. As prospective homebuyers, we wish to know the elevation of thewater after it has collected in low-lying squares, and also the percentage ofthe region's area that is completely submerged (that is, the percentage of10-meter squares whose elevation is strictly less than the water level). Youare to write the program that provides these results.

    Input

    The input consists of asequence of region descriptions. Each begins with a pair of integers, mand n, each less than 30, giving the dimensions of the rectangularregion in 10-meter units. Immediately following are m lines of nintegers giving the elevations of the squares in row-major order. Elevationsare given in meters, with positive and negative numbers representing elevationsabove and below sea level, respectively. The final value in each region descriptionis an integer that indicates the number of cubic meters of water that willcollect in the region. A pair of zeroes follows the description of the lastregion.

    Output

    For each region, display the region number (1, 2, ...), the water level (in meters above or below sealevel) and the percentage of the region's area under water, each on a separateline. The water level and percentage of the region's area under water are to bedisplayed accurate to two fractional digits. Follow the output for each region with a blank line.

    Sample Input

    3 3
    25 37 45
    51 12 34
    94 83 27
    10000
    0 0

    Sample Output

    Region 1
    Water level is 46.67 meters.
    66.67 percent of the region is under water.

    Author

    样例输入

    3 3
    25 37 45
    51 12 34
    94 83 27
    10000
    0 0

    样例输出

    Region 1
    Water level is 46.67 meters.
    66.67 percent of the region is under water.

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部