摘要:
By property of mod operations , we can simply use Divide and Conquer + Recursion to solve it. Reference:https://www.khanacademy.org/math/applied-math/cryptography/modarithmetic/a/modular-exponentiationMy Ruby version is:DIV = 20def ferma(x, y, n) c = 1 for i in 0..y-1 c = (c * x) % n ... 阅读全文
posted @ 2014-02-20 03:39
Tonix
阅读(197)
评论(0)
推荐(0)

浙公网安备 33010602011771号