vlatkovski

gcd (greatest common divisor); O(log N)

Sep 30th, 2017
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.07 KB | None | 0 0
  1. int gcd(int a, int b)
  2. {
  3.     if (b==0) return a;
  4.     return gcd(b, a%b);
  5. }
Advertisement
Add Comment
Please, Sign In to add comment