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)