Flooded UVA815翻译原题+代码

网友投稿 745 2022-08-26

Flooded UVA815翻译原题+代码

Flooded UVA815翻译原题+代码

英语实在是不好,题意都看不懂,背单词又背不下去,那就慢慢翻译吧,反正没事干。

翻译不求用词精准,句子也可能不通顺, 只是能理解了题意就好。

To enable homebuyers to estimate the cost of flood insurance, a real-estate firm provides clients with the elevation of each 10-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 in those squares with the lowest elevations, since water from squares of higher elevation will run downhill.来自雨水,融雪,爆炸的水会先聚积在海拔最低的地方,因为高地的水会流下来。

For simplicity, we also  assume that storm sewers enable water from high-elevation squares in valleys (completely enclosed by still higher elevation squares) to drain to lower elevation squares, and that water will not be absorbed by the land.简单的,我们假设地沟水能够来自高海拔地区山谷(完全被高海拔地区包围)排向低海拔地区,而且谁不会被陆地吸收。

From weather data archives, we know the typical volume of water that collects in a region.从天气档案来看,我们知道典型大量的水聚积与一个地区。

As prospective homebuyers, we wish to know the elevation of the water after it has collected in low-lying squares, and also the percentage of the region's area that is completely submerged (that is, the percentage of 10-meter squares whose elevation is strictly less than the water level).作为一个买房子的人,我们希望知道在低洼地区聚积的水的海拔,和被完全淹没地区的百分比(即,每10米的百分数海拔严格少于水的高度)。

#include #include #include #include using namespace std;double a[100000];double vol[100000];int m,n;double v1,v2;bool cmp(double aa, double bb){ if(aa>bb) return true;}int main(){ int kase=0; while(scanf("%d%d", &m, &n)!=EOF && !( m==0 && n==0 ) ) { kase++; v1=0; double temp; for(int i=0; i>temp; vol[i] = temp*100; v1 += vol[i]; a[i] = temp; } sort(a, a+m*n, cmp); sort(vol, vol+m*n, cmp); cin>>v2; double v = v1+v2; double height; int r = m*n; for(int i=0; i a[i]) { height = temp1; break; } else { v = v - a[i]*100; r--; } } printf("Region %d\n",kase); printf("Water level is %.2lf meters.\n", height); printf("%.2f percent of the region is under water.\n\n",(r+0.0)/(m*n)*100); } return 0;}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Yii CModel中rules验证规格
下一篇:Android目录结构介绍
相关文章

 发表评论

暂时没有评论,来抢沙发吧~