data structure

Правка en1, от 123_123_123_123, 2018-12-02 22:26:45

You are given a 3-D Matrix in which each block contains 0 initially. The first block is defined by the coordinate (1,1,1) and the last block is defined by the coordinate (N,N,N). There are two types of queries. UPDATE x1 y1 z1 x2 y2 z2 W updates the value of each block whose x coordinate is between x1 and x2 (inclusive), y coordinate between y1 and y2 (inclusive) and z coordinate between z1 and z2 (inclusive) to W. QUERY x1 y1 z1 x2 y2 z2 calculates the sum of the value of blocks whose x coordinate is between x1 and x2 (inclusive), y coordinate between y1 and y2 (inclusive) and z coordinate between z1 and z2 (inclusive). where n<=100,m<=1000 what will be the solution of this problem? I have a solution which has a complexity of n*m*log4(n*n) but I really doubt about log4(n*m) part. I am really confused.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский 123_123_123_123 2018-12-02 22:26:45 836 Initial revision (published)