Monday, 16 February 2015

Mathematical Formulas for Programmer

Below are some of the formulas that can be useful while doing competitive programming.
  • 1∗1!+2∗2!+...+x∗x! = (x+1)!−1
  • (A+B)%C = (A%C + B%C )%C. 
  • (A* B)%C = ((A%C) * (B%C))%C 
  • LCM(a, b) = (a * b) / GCD(a, b)
     
I will be adding more formulas to it.
Please comment if you find anything incorrect.

No comments:

Post a Comment