Math and Query

Revision en1, by Tboros_kylie, 2024-08-22 06:31:25

I have two problems

(1): You are given a m x n grid , with each a[i][j] = 0 or 1 , counting sum of rectangles made from 1 (m*n <= 1e6) Ex:

3 2

1 0 1 1 1 0

Ans: 8

(2): We are given n paragraph , call [l;r] , and q queries paragraph call [u;v] , each queries , we need to count how many [l;r] satisfied this condition: u <= l <= r <= v

(l,r,u,v <= 1e5)

Tags math, data structures

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Tboros_kylie 2024-08-22 06:31:25 391 Initial revision (published)