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:本题的思想In Reply To:本题的思想 Posted by:roc496 at 2009-05-07 15:02:30 > /************************************* > * 中国剩余定理 > * q mod i = x, q mod j = y, q mod k = z > * 令 A = j*k*a, A mod i = 1; > * B = i*k*b, B mod j = 1; > * C = i*j*c, C mod k = 1; > * 得到 circle = A+B+C -1 > * q(min) = (A*i + B*j + C*k)%circle > *************************************/ > 直接计算出ABC之后再代入计算 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator