Wednesday, January 29, 2014

SPOJ 1724. Counting Triangles

Here is the problem statement

This problem is one type of a problem which I can't explain. You just need to take pen and paper , draw a few examples and the solution will pump up on your brain. SO If you tried many times and very tired of it I can give you the formula.

Here is the formula

A[N]=  ( n*(2*n+1)*(n+2)   )/8


       DOWNLOAD THE FULL SOURCE CODE

No comments:

Post a Comment