Areas on the Cross-Section Diagram数据结构应用——计算面积

该博客介绍了一个模拟洪水损害的问题,基于给定的地形剖面图计算被水淹没区域的面积。输入是一个由'/', ''和'_'组成的字符串,表示斜坡和平地。输出是洪水区域的总面积及从左到右的各个区域面积。题目提供了样例输入和输出,并附带了一个C++实现,作者计划后续添加Java版本。" 7895814,1292758,自定义Android CheckBoxPreference样式,"['Android开发', '用户界面', '自定义组件', 'Preference']
摘要由CSDN通过智能技术生成

题目链接

Your task is to simulate a flood damage.
For a given cross-section diagram, reports areas of flooded sections.

在这里插入图片描述
Assume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides. For example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.

INPUT
A string, which represents slopes and flatlands by ‘/’, ‘’ and '’ respectively, is given in a line. For example, the region of the above example is given by a string "\///_//\\//\///__\_\///".
OUTPUT
Report the areas of floods in the follo

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值