• 欢迎访问废江's博客 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏本站吧

Areas on the Cross-Section Diagram

AOJ 站点默认 6个月前 (04-09) 316次浏览 已收录 0个评论
文章目录[隐藏]

Question

NqUgv.png
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 following format:
A
k L1 ,L2 …Lk
In the first line, print the total area A of created floods.
Nq9CU.png
Nqar0.png

Meaning

Sloution

Coding

Summary


个人博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Areas on the Cross-Section Diagram
喜欢 (0)
[]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到