daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Nov 19th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def powm(a,n,m):
  2.     def power(a, n):
  3.         if n == 0:
  4.             return 1
  5.         elif n % 2 == 1:
  6.             return power(a, n - 1) * a
  7.         else:
  8.             return power(a, n // 2) ** 2
  9.     c=power(a,n)
  10.     k=c%m
  11.     return k
RAW Paste Data
Top