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

Sersp3's blog

By Sersp3, history, 2 months ago, In English

I couldn't find this particular approach in existing editorials, so I decided to share it.

1. Problem

You are given a 2D table $$$a$$$ with $$$n$$$ rows and $$$m$$$ columns. You need to answer $$$q$$$ queries offline. Each query is four integers $$$x_1$$$ $$$y_1$$$ $$$x_2$$$ $$$y_2$$$ describing a rectangle. For each query, you need to output

$$$\sum\limits_{i=x_1}^{x_2} (\max\limits_{j=y_1}^{y_2} a_{i, j})$$$

Full text and comments »

  • Vote: I like it
  • +71
  • Vote: I do not like it