How to count number of all rectangle that contain all the same number in matrix

Правка en2, от ProblemAsker, 2020-06-11 17:34:04

There are n*m matrix (n,m<=1000) each element in the matrix are between 1 and 1e9 Count number of all rectangle in matrix that contain all the same element

how to solve this? I have been thinking for 2 days. Thank you very much.

Example:

Input:

2 3

1 1 2

1 1 2

output : 12

Теги #dynamic programing, #math

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский ProblemAsker 2020-06-11 17:34:04 9
en1 Английский ProblemAsker 2020-06-11 17:22:04 368 Initial revision (published)