Libraion's blog

By Libraion, history, 4 years ago, In English

Given a 2D table of size $$$n \times m (n, m \leq 400)$$$. Cell $$$(i, j)$$$ has value $$$a[i][j] \leq 10^6$$$. Find the rectangle which has maximum area and the rectangle consists of pairwise distinct values.

Input:

3 3

1 3 4

2 4 3

5 6 3

Output: 6. (Rectangle $$$(1,1) \rightarrow (3, 2)$$$).

Thanks! <3

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

»
4 years ago, # |
  Vote: I like it +13 Vote: I do not like it