| ||||||||||
| 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 | |||||||||
这样做错的,例如计算f(6,2,8)In Reply To:偶是这样做的。。。。 Posted by:achilles at 2005-12-08 11:01:03 > 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