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

Re:请问怎么求平方之后模那个数的余数呢?

Posted by alpc02 at 2007-03-09 08:14:03 on Problem 1811
In Reply To:请问怎么求平方之后模那个数的余数呢? Posted by:cmc_hope at 2007-03-08 15:59:15
a*b = a*(b/2)*2 + a*(b%2)     (% c)
用同样的方法求 a*(b/2)%c
这样就不会越界

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