Блог пользователя Sersp3

Автор Sersp3, история, 3 месяца назад, По-английски

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})$$$

Полный текст и комментарии »

  • Проголосовать: нравится
  • +71
  • Проголосовать: не нравится