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:O(1)算法(中国剩余定理)

Posted by justdone at 2008-08-23 20:41:40 on Problem 1006
In Reply To:Re:O(1)算法(中国剩余定理) Posted by:814469583 at 2008-03-22 16:06:07
> 拜托,哪位大哥能说说具体的算法啊?就那几个数字咋来的呀?

  23 33 28 
  用这个方法得到值 ;
   
  if(((23*33)*i)%28==1) 
     a = 23*33*i ;
同理 :
  b =
  c = ; 解决
  因为:p+23(n-1)
       e+28*(n-1)
       i + 33*(n-1)
(知道上面三个是怎么来的吧) 
     所以  


   result =( a*e +b *i +c*p -d +25212)%25212



  打完收工  

  我郁闷啊 我的还没搞定呢  嘿嘿

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