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:多谢,改了就ACIn Reply To:避免中间过程超long long的方法 Posted by:chinabest at 2014-01-14 19:56:30 > 关键就在于求出方程的解有可能很大很大,要马上模掉。 > 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行就会越界。加油吧————各位。 多谢了,看了这发现就是中间过程爆longlong,改了就AC Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator