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:justdone at 2008-08-23 20:41:40 给定一个正整数n,我们说两个数a、b是对模n同余,如果a-b是n的倍数。用符号a≡b(mod n)来代表。一般来说,a≡b(mod n)等同于a=b+kn,而a,b,k,n都是整数,所以,13≡1(mod 6)、19≡1(mod 6)。 (一)整数加法跟普通加法相似,a+c≡(b+c)(mod n); (二)整数乘法跟普通乘法相似,ac≡bc(mod n), Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator