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 |
本题的思想/************************************* * 中国剩余定理 * 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之后再代入计算q Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator