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 |
避免中间过程超long long的方法关键就在于求出方程的解有可能很大很大,要马上模掉。 code: z=(r2-r1)/rnt*z; I64 tmp=m2/rnt; z=((z % tmp) + tmp) % tmp; r1=m1*z+r1; m1=m1/rnt*m2; r1%=m1; 如果没有第三行的话,在第4行就会越界。加油吧————各位。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator