You are not logged in. Please login at www.codechef.com to post your questions!

×

(unsolved) a hard problem

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

caobao_'s gravatar image

6★caobao_
-31
accept rate: 0%

edited 26 Sep '18, 21:10

Please give the link of the question....

(27 Sep '18, 08:23) l_returns5★

To ensure it is not from any ongoing contest

(27 Sep '18, 08:26) l_returns5★

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
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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