Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年2月20日

摘要: 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)