Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这样做错的,例如计算f(6,2,8)

Posted by zhucheng at 2005-12-08 12:36:08 on Problem 2720
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator