Help in this Geometrical (counting) concept..

Правка en1, от forget_it, 2020-03-16 16:01:50

How to count number of squares posible in a m*n grid.

I know formula to count squares which are parallel to given grid. i.e. m*(m+1)*(2m+1)/6 + (n-m)*m*(m+1)/2;

but how to do it for squares which are not parallel to given grid. How to count them??

Теги #counting, #c++, #competitive, #geometry

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский forget_it 2020-03-16 16:01:50 305 Initial revision (published)