Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
偶是这样做的。。。。In Reply To:就是四川大学上的那个power and power again吧..不过我的方法比较慢... Posted by:achilles at 2005-12-08 01:00:23 llong f(llong a, llong n, llong m) { if (m == 0) { return 1; } if (n == 1) { return a % m; } int e = euler( m ); int nn = f(a, n-1, e); if (nn == 0) nn = e; return mod_pow(a, nn, m); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator