Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

burakcetin's blog

By burakcetin, 12 years ago, In English

Is there any good explanation for the idea behind finding max area sub-rectangle in a histogram problem? And some tasks involving the same idea. It seems to be used in much harder problems as a sub-problem and i am having hard time about it.

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
12 years ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

Hackerrank-Farmer.

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I am not sure what problem you are talking about. Is it like this one?

If yes, solution of it is pretty classical and you can read about it here

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

A simple stack implementation solves this problem, try to see if you can see why.