| ||||||||||
| 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 | |||||||||
Re:O(1)算法(中国剩余定理)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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator