×

# (unsolved) a hard problem

 0 Given N non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. It'easy. So you can inc some bar,but the sum of the height you inc no more than M. Now,maximize the answer. 1 <= N <= 1000 0 <= M <= 1000 0 <= ai <= 1000 For example, n = 3,m = 0 A : [1 , 0 , 1] answer : 1 n = 3, m = 2 A : [1 , 0 , 1] answer : 2 (you can inc a[1] and a[3]) asked 21 Sep '18, 19:01 6★caobao_ -3●1 accept rate: 0% Please give the link of the question.... (27 Sep '18, 08:23) To ensure it is not from any ongoing contest (27 Sep '18, 08:26) Not link,just some one ask for help,all of them are integer. I hava a idea but it's O(nm^2) (27 Sep '18, 17:35) caobao_6★
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,343
×678

question asked: 21 Sep '18, 19:01

question was seen: 137 times

last updated: 27 Sep '18, 17:35