B. Count Subrectangles time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output You are given an array aa of length nn and array bb of length mm both consisting of only integers 00 and 11. Consider a matrix cc of size n×mn×m formed by following rule: ci,j=ai⋅bjci,j=ai⋅bj (i.e. aiai multiplied by bjbj). It's easy to see that cc consists of only zeroes and ones too. How many subrectangles of size (area) kk consisting only of ones are there in cc? A subrectangle is an intersection of a consecutive (subsequent) segment of rows and a consecutive (subsequent) segment of column |
B. Count Subrectangles
猜你喜欢
转载自blog.csdn.net/chen_zan_yu_/article/details/104785691
今日推荐
周排行