Query on a matrix

Правка en1, от thedebater, 2020-03-22 20:58:18

We are given a matrix M of dimension N*N. All the cells are initially, zero. Also we are given Q queries, which contains 4 integers a b c d. where (a,b) is the TOP LEFT cell and (c,d) is the Bottom Right cell of a submatrix. Now, all the cells of This submatrix has to be incremented by one. After all the Q queries have been performed. Your task is to print the final resulting Matrix.

I know the 1-D version of this problem. But I'm having difficulties implementing it in 2-D form. Any inputs regarding the same?

Теги #matrix, #dynamic programing, #problem solving

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский thedebater 2020-03-22 20:58:18 545 Initial revision (published)